You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Marcello Teodori (JIRA)" <ji...@apache.org> on 2006/07/27 15:16:21 UTC

[jira] Created: (SB-34) from putLIst returns ComponentAttribute instead of List

<tiles:importAttribute> from putLIst returns ComponentAttribute instead of List
-------------------------------------------------------------------------------

                 Key: SB-34
                 URL: http://issues.apache.org/struts/browse/SB-34
             Project: Sandbox
          Issue Type: Bug
          Components: Tiles
    Affects Versions: 2.0
         Environment: Mac OS X 10.4.7, Java SE 1.5.0_06, JBoss 4.0.4 GA EJB3, JBoss Seam 1.0.1 GA, JSTL 1.1
            Reporter: Marcello Teodori


when adding a list of attributes in a tiles definition with putList then when I try to get the list of values from a JSP I get a ClassCastException.

Investigating further the returned object is of type ComponentAttribute, so I had to get its "value" JavaBean attribute to iterate over it as a List, that is:

    <tiles:importAttribute name="stylesheets" ignore="true"/>
    <c:forEach var="stylesheet" items="${stylesheets.value}">
    <link rel="stylesheet" type="text/css" media="all" href="${pageContext.request.contextPath}/${stylesheet}" />
    </c:forEach>

while from the documentation in Struts Tiles I should have used ${stylesheets} instead of ${stylesheets.value}



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (SB-34) from putLIst returns ComponentAttribute instead of List

Posted by "Antonio Petrelli (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/struts/browse/SB-34?page=all ]

Antonio Petrelli resolved SB-34.
--------------------------------

    Fix Version/s: 2.0
       Resolution: Fixed

After correcting the issue, I added a test link to the test webapp.

> <tiles:importAttribute> from putLIst returns ComponentAttribute instead of List
> -------------------------------------------------------------------------------
>
>                 Key: SB-34
>                 URL: http://issues.apache.org/struts/browse/SB-34
>             Project: Sandbox
>          Issue Type: Bug
>          Components: Tiles
>    Affects Versions: 2.0
>         Environment: Mac OS X 10.4.7, Java SE 1.5.0_06, JBoss 4.0.4 GA EJB3, JBoss Seam 1.0.1 GA, JSTL 1.1
>            Reporter: Marcello Teodori
>         Assigned To: Antonio Petrelli
>             Fix For: 2.0
>
>
> when adding a list of attributes in a tiles definition with putList then when I try to get the list of values from a JSP I get a ClassCastException.
> Investigating further the returned object is of type ComponentAttribute, so I had to get its "value" JavaBean attribute to iterate over it as a List, that is:
>     <tiles:importAttribute name="stylesheets" ignore="true"/>
>     <c:forEach var="stylesheet" items="${stylesheets.value}">
>     <link rel="stylesheet" type="text/css" media="all" href="${pageContext.request.contextPath}/${stylesheet}" />
>     </c:forEach>
> while from the documentation in Struts Tiles I should have used ${stylesheets} instead of ${stylesheets.value}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Work stopped: (SB-34) from putLIst returns ComponentAttribute instead of List

Posted by "Antonio Petrelli (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/struts/browse/SB-34?page=all ]

Work on SB-34 stopped by Antonio Petrelli.

> <tiles:importAttribute> from putLIst returns ComponentAttribute instead of List
> -------------------------------------------------------------------------------
>
>                 Key: SB-34
>                 URL: http://issues.apache.org/struts/browse/SB-34
>             Project: Sandbox
>          Issue Type: Bug
>          Components: Tiles
>    Affects Versions: 2.0
>         Environment: Mac OS X 10.4.7, Java SE 1.5.0_06, JBoss 4.0.4 GA EJB3, JBoss Seam 1.0.1 GA, JSTL 1.1
>            Reporter: Marcello Teodori
>         Assigned To: Antonio Petrelli
>
> when adding a list of attributes in a tiles definition with putList then when I try to get the list of values from a JSP I get a ClassCastException.
> Investigating further the returned object is of type ComponentAttribute, so I had to get its "value" JavaBean attribute to iterate over it as a List, that is:
>     <tiles:importAttribute name="stylesheets" ignore="true"/>
>     <c:forEach var="stylesheet" items="${stylesheets.value}">
>     <link rel="stylesheet" type="text/css" media="all" href="${pageContext.request.contextPath}/${stylesheet}" />
>     </c:forEach>
> while from the documentation in Struts Tiles I should have used ${stylesheets} instead of ${stylesheets.value}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (SB-34) from putLIst returns ComponentAttribute instead of List

Posted by "Antonio Petrelli (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/SB-34?page=comments#action_38127 ] 
            
Antonio Petrelli commented on SB-34:
------------------------------------

I modified and committed ImportAttributeTag. I tested locally using a local version of JSTL and it seems to work now. Anyway I should wait until JSTL dependency is added to commit the test code and resolve the issue.
In the meanwhile, Marcello, can you check if it works now also for you? Thank you.

> <tiles:importAttribute> from putLIst returns ComponentAttribute instead of List
> -------------------------------------------------------------------------------
>
>                 Key: SB-34
>                 URL: http://issues.apache.org/struts/browse/SB-34
>             Project: Sandbox
>          Issue Type: Bug
>          Components: Tiles
>    Affects Versions: 2.0
>         Environment: Mac OS X 10.4.7, Java SE 1.5.0_06, JBoss 4.0.4 GA EJB3, JBoss Seam 1.0.1 GA, JSTL 1.1
>            Reporter: Marcello Teodori
>         Assigned To: Antonio Petrelli
>
> when adding a list of attributes in a tiles definition with putList then when I try to get the list of values from a JSP I get a ClassCastException.
> Investigating further the returned object is of type ComponentAttribute, so I had to get its "value" JavaBean attribute to iterate over it as a List, that is:
>     <tiles:importAttribute name="stylesheets" ignore="true"/>
>     <c:forEach var="stylesheet" items="${stylesheets.value}">
>     <link rel="stylesheet" type="text/css" media="all" href="${pageContext.request.contextPath}/${stylesheet}" />
>     </c:forEach>
> while from the documentation in Struts Tiles I should have used ${stylesheets} instead of ${stylesheets.value}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Assigned: (SB-34) from putLIst returns ComponentAttribute instead of List

Posted by "Antonio Petrelli (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/struts/browse/SB-34?page=all ]

Antonio Petrelli reassigned SB-34:
----------------------------------

    Assignee: Antonio Petrelli

> <tiles:importAttribute> from putLIst returns ComponentAttribute instead of List
> -------------------------------------------------------------------------------
>
>                 Key: SB-34
>                 URL: http://issues.apache.org/struts/browse/SB-34
>             Project: Sandbox
>          Issue Type: Bug
>          Components: Tiles
>    Affects Versions: 2.0
>         Environment: Mac OS X 10.4.7, Java SE 1.5.0_06, JBoss 4.0.4 GA EJB3, JBoss Seam 1.0.1 GA, JSTL 1.1
>            Reporter: Marcello Teodori
>         Assigned To: Antonio Petrelli
>
> when adding a list of attributes in a tiles definition with putList then when I try to get the list of values from a JSP I get a ClassCastException.
> Investigating further the returned object is of type ComponentAttribute, so I had to get its "value" JavaBean attribute to iterate over it as a List, that is:
>     <tiles:importAttribute name="stylesheets" ignore="true"/>
>     <c:forEach var="stylesheet" items="${stylesheets.value}">
>     <link rel="stylesheet" type="text/css" media="all" href="${pageContext.request.contextPath}/${stylesheet}" />
>     </c:forEach>
> while from the documentation in Struts Tiles I should have used ${stylesheets} instead of ${stylesheets.value}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (SB-34) from putLIst returns ComponentAttribute instead of List

Posted by "Antonio Petrelli (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/SB-34?page=comments#action_38144 ] 
            
Antonio Petrelli commented on SB-34:
------------------------------------

I forgot to tell that I also added a dependency on JSTL

> <tiles:importAttribute> from putLIst returns ComponentAttribute instead of List
> -------------------------------------------------------------------------------
>
>                 Key: SB-34
>                 URL: http://issues.apache.org/struts/browse/SB-34
>             Project: Sandbox
>          Issue Type: Bug
>          Components: Tiles
>    Affects Versions: 2.0
>         Environment: Mac OS X 10.4.7, Java SE 1.5.0_06, JBoss 4.0.4 GA EJB3, JBoss Seam 1.0.1 GA, JSTL 1.1
>            Reporter: Marcello Teodori
>         Assigned To: Antonio Petrelli
>             Fix For: 2.0
>
>
> when adding a list of attributes in a tiles definition with putList then when I try to get the list of values from a JSP I get a ClassCastException.
> Investigating further the returned object is of type ComponentAttribute, so I had to get its "value" JavaBean attribute to iterate over it as a List, that is:
>     <tiles:importAttribute name="stylesheets" ignore="true"/>
>     <c:forEach var="stylesheet" items="${stylesheets.value}">
>     <link rel="stylesheet" type="text/css" media="all" href="${pageContext.request.contextPath}/${stylesheet}" />
>     </c:forEach>
> while from the documentation in Struts Tiles I should have used ${stylesheets} instead of ${stylesheets.value}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Work started: (SB-34) from putLIst returns ComponentAttribute instead of List

Posted by "Antonio Petrelli (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/struts/browse/SB-34?page=all ]

Work on SB-34 started by Antonio Petrelli.

> <tiles:importAttribute> from putLIst returns ComponentAttribute instead of List
> -------------------------------------------------------------------------------
>
>                 Key: SB-34
>                 URL: http://issues.apache.org/struts/browse/SB-34
>             Project: Sandbox
>          Issue Type: Bug
>          Components: Tiles
>    Affects Versions: 2.0
>         Environment: Mac OS X 10.4.7, Java SE 1.5.0_06, JBoss 4.0.4 GA EJB3, JBoss Seam 1.0.1 GA, JSTL 1.1
>            Reporter: Marcello Teodori
>         Assigned To: Antonio Petrelli
>
> when adding a list of attributes in a tiles definition with putList then when I try to get the list of values from a JSP I get a ClassCastException.
> Investigating further the returned object is of type ComponentAttribute, so I had to get its "value" JavaBean attribute to iterate over it as a List, that is:
>     <tiles:importAttribute name="stylesheets" ignore="true"/>
>     <c:forEach var="stylesheet" items="${stylesheets.value}">
>     <link rel="stylesheet" type="text/css" media="all" href="${pageContext.request.contextPath}/${stylesheet}" />
>     </c:forEach>
> while from the documentation in Struts Tiles I should have used ${stylesheets} instead of ${stylesheets.value}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (SB-34) from putLIst returns ComponentAttribute instead of List

Posted by "Antonio Petrelli (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/SB-34?page=comments#action_38111 ] 
            
Antonio Petrelli commented on SB-34:
------------------------------------

It seems that there is the same problem with a simple attribute: in this case we have a ComponentAttribute instance. The difference is that ComponentAttribute has "toString" method overriden that returns the value's "toString" result. But it is an issue anyway.

> <tiles:importAttribute> from putLIst returns ComponentAttribute instead of List
> -------------------------------------------------------------------------------
>
>                 Key: SB-34
>                 URL: http://issues.apache.org/struts/browse/SB-34
>             Project: Sandbox
>          Issue Type: Bug
>          Components: Tiles
>    Affects Versions: 2.0
>         Environment: Mac OS X 10.4.7, Java SE 1.5.0_06, JBoss 4.0.4 GA EJB3, JBoss Seam 1.0.1 GA, JSTL 1.1
>            Reporter: Marcello Teodori
>         Assigned To: Antonio Petrelli
>
> when adding a list of attributes in a tiles definition with putList then when I try to get the list of values from a JSP I get a ClassCastException.
> Investigating further the returned object is of type ComponentAttribute, so I had to get its "value" JavaBean attribute to iterate over it as a List, that is:
>     <tiles:importAttribute name="stylesheets" ignore="true"/>
>     <c:forEach var="stylesheet" items="${stylesheets.value}">
>     <link rel="stylesheet" type="text/css" media="all" href="${pageContext.request.contextPath}/${stylesheet}" />
>     </c:forEach>
> while from the documentation in Struts Tiles I should have used ${stylesheets} instead of ${stylesheets.value}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (SB-34) from putLIst returns ComponentAttribute instead of List

Posted by "Marcello Teodori (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/SB-34?page=comments#action_38145 ] 
            
Marcello Teodori commented on SB-34:
------------------------------------

I can confirm it works in my environment too. Thanks!

> <tiles:importAttribute> from putLIst returns ComponentAttribute instead of List
> -------------------------------------------------------------------------------
>
>                 Key: SB-34
>                 URL: http://issues.apache.org/struts/browse/SB-34
>             Project: Sandbox
>          Issue Type: Bug
>          Components: Tiles
>    Affects Versions: 2.0
>         Environment: Mac OS X 10.4.7, Java SE 1.5.0_06, JBoss 4.0.4 GA EJB3, JBoss Seam 1.0.1 GA, JSTL 1.1
>            Reporter: Marcello Teodori
>         Assigned To: Antonio Petrelli
>             Fix For: 2.0
>
>
> when adding a list of attributes in a tiles definition with putList then when I try to get the list of values from a JSP I get a ClassCastException.
> Investigating further the returned object is of type ComponentAttribute, so I had to get its "value" JavaBean attribute to iterate over it as a List, that is:
>     <tiles:importAttribute name="stylesheets" ignore="true"/>
>     <c:forEach var="stylesheet" items="${stylesheets.value}">
>     <link rel="stylesheet" type="text/css" media="all" href="${pageContext.request.contextPath}/${stylesheet}" />
>     </c:forEach>
> while from the documentation in Struts Tiles I should have used ${stylesheets} instead of ${stylesheets.value}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira