[ 
https://issues.apache.org/jira/browse/SLING-3217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13809008#comment-13809008
 ] 

Justin Edelson commented on SLING-3217:
---------------------------------------

Scripting variables and EL expresions have entirely separate namespaces. It is 
true that users of <sling:defineObjects/> end up with the same baseline 
variable names, as soon as you write any non-trivial code, the namespaces 
diverge.

Consider that both of these (very contrived examples) will fail:
{code}
<sling:defineObjects/>
<% String path = resource.getPath() %>
${path} 
{code}

{code}
<sling:defineObjects/>
<c:set var="path" value="${resource.path}"/>
<%= path %>
{code}


> Automatically expose SlingBindings object through EL
> ----------------------------------------------------
>
>                 Key: SLING-3217
>                 URL: https://issues.apache.org/jira/browse/SLING-3217
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>            Reporter: Justin Edelson
>         Attachments: SLING-3217.patch
>
>
> JSP scripts need to use the <sling:defineObjects/> (or a subclass) in order 
> to expose the Sling Bindings objects (i.e. `resource`) for use in a JSP page. 
> This shouldn't be necessary if we provide a custom ELResolver.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to