[ 
https://issues.apache.org/jira/browse/SLING-37?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Felix Meschberger closed SLING-37.
----------------------------------

    Resolution: Fixed

Redone the script selection in the ScriptedComponent to apply the request 
selectors to the default script selection. In addtion, modified the default 
name to be "default.jsp" and not looking in a jsp folder any more.

Also clarified the ScriptHandler.getComponentRenderer method to return null if 
the script cannot be handled by the script handler because it is missing. Not 
returning null does not prevent any errors from being thrown at the time of 
calling the script of course. This is just a simple upfront check.

Fixed in Rev. 581895.

Adapted the JSP handler to return null in case the requested script is not 
available in the repository.

Fixed in Rev. 581898.

> Better default handling for script selection
> --------------------------------------------
>
>                 Key: SLING-37
>                 URL: https://issues.apache.org/jira/browse/SLING-37
>             Project: Sling
>          Issue Type: New Feature
>          Components: Scripting
>    Affects Versions: 2.0.0
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: 2.0.0
>
>
> Currently the ScriptedComponent analyzes the registered scripts and just 
> falls back to a default script called jsp/start.jsp. This default selection 
> should be extended such, that request selectors (see 
> ComponentRequest.getSelectors()) contrubute to the script selection as 
> follows:
>     - First apply all registered Script mappings of the ScriptedComponent
>     - Next use the request selectors to find a script below the scripted 
> component node
>     - If the second step does not resolve a script (or if no selectors exist) 
> just use the start.jsp script below the component node
> The second step needs some more explanations: The selectors of the request 
> are joined with interleaving slashes to form a relative path. This path is 
> appended to the path of the scripted component and the name of script is 
> assumed to be start.jsp. If the path does not exist, trailing elements are 
> just removed and such a longest match is tried to be found.
> Example: 
> (1) request for sample.html
> No selectors exist, the start.jsp script below the component is used
> (2) request for sample.image.gif
> Selector is a single entry list [ image ]. First the script image/start.jsp 
> is checked, if that does not exist, the start.jsp is used.
> (3) request for sample.image.80x80.gif
> The selectors is a two-entry list [ image, 80x80 ]. The following scripts are 
> tested in order: image/80x80/start.jsp, image/start.jsp, start.jsp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to