Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-5653

adaptTo tag fails when adaptTo parameter is an expression

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Scripting JSP-Taglib 2.2.4
    • Scripting
    • None

    Description

      The following code sample fails:

      <c:set var="dest" value="org.apache.sling.api.resource.ValueMap"/> 
      <sling:adaptTo adaptable="${resource}" adaptTo="${dest}" var="props5"/>
      

      Root cause seems to be

      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)

      Attachments

        1. SLING-5653-tentative.patch
          3 kB
          Julian Sedding
        2. SLING-5653-unexpected-object.png
          134 kB
          Robert Munteanu

        Issue Links

          Activity

            People

              jsedding Julian Sedding
              rombert Robert Munteanu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: