You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2003/11/11 17:56:50 UTC

DO NOT REPLY [Bug 24612] New: - The "collection" attribute of the tag does not lookup the object in the specified scope

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24612>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24612

The "collection" attribute of the <logic:iterator> tag does not lookup the object in the specified scope

           Summary: The "collection" attribute of the <logic:iterator> tag
                    does not lookup the object in the specified scope
           Product: Struts
           Version: 1.1 Final
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Custom Tags
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: dinu@zappmobile.ro
                CC: dinu@zappmobile.ro


The doStartTag() method in IterateTag.java class assigns the string value of 
the "collection" attribute of the tag to the "collection" global variable of 
the class. Therefore, the logic:iterate tag used with the "collection" 
attribute will always be initialized with the name of the Collection to 
iterate and not the Collection itself (so it will be a String), and the method 
will always throw the "Cannot iterate over this collection" exception.

to reproduce, jsp code:

----- cut here ------
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<% 
java.util.Vector v = new java.util.Vector();
v.add("Foo");
v.add("Bar");
pageContext.setAttribute ("MyCollection", v.elements());
%>
<logic:iterate collection="MyCollection" id="collectionItem">
<%=collectionItem%>
</logic:iterate>
----------- cut here -----------

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org