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

Julian Sedding commented on SLING-5653:
---------------------------------------

Thanks for your inputs! I'll take over and will make sure to test for the 
pitfall Justin has mentioned. Maybe we need to return an empty array of 
{{VariableInfo}} from {{AdaptToTEI.getVariableInfo()}} to signal that we don't 
know.

Forbidding expressions would be backwards incompatible, so hopefully we can 
avoid it.

> adaptTo tag fails when adaptTo parameter is an expression
> ---------------------------------------------------------
>
>                 Key: SLING-5653
>                 URL: https://issues.apache.org/jira/browse/SLING-5653
>             Project: Sling
>          Issue Type: Bug
>          Components: Scripting
>    Affects Versions: Scripting JSP-Taglib 2.2.4
>            Reporter: Robert Munteanu
>            Assignee: Julian Sedding
>             Fix For: Scripting JSP-Taglib 2.2.6
>
>         Attachments: SLING-5653-tentative.patch, 
> SLING-5653-unexpected-object.png
>
>
> The following code sample fails:
> {code:java}
> <c:set var="dest" value="org.apache.sling.api.resource.ValueMap"/> 
> <sling:adaptTo adaptable="${resource}" adaptTo="${dest}" var="props5"/>
> {code}
> Root cause seems to be
> {noformat}Caused by: java.lang.ClassCastException: java.lang.Object cannot be 
> cast to java.lang.String
>       at javax.servlet.jsp.tagext.TagData.getAttributeString(TagData.java:138)
>       at 
> org.apache.sling.scripting.jsp.taglib.tei.AdaptToTEI.getClassName(AdaptToTEI.java:26){noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to