Re-read the API description of this tag and the "collection" attribute:
"A runtime expression that evaluates to a collection (conforming to the
requirements listed above) to be iterated over."
You've given it a string, "rows", and not a collection. This is a
situation where using Struts-EL is convenient. You'd just replace
"rows" with "${rows}".
> -----Original Message-----
> From: Troy Bull [mailto:[EMAIL PROTECTED]
> Sent: Thursday, October 20, 2005 8:26 AM
> To: Struts Users Mailing List
> Subject: Problems with Iterator tag Please Help
>
>
> Hello
>
> I have a situation here. I have an ArrayList of DTO objects
> in session.
>
> <%
> ArrayList rows = (ArrayList) session.getAttribute("rows");
> if (rows != null) {
> Iterator i = rows.iterator();
> while (i.hasNext())
> {
> NibuSrchVLocalDTO debug = (NibuSrchVLocalDTO)i.next();
> out.println("Name: " + debug.getFullName() + "<BR>");
> }
> }
> %>
>
> This code here (scriptlet above this line) works perfectly but
>
> <logic:present name="rows" scope="session">
> <logic:iterate id="row" scope="session"
> collection="rows">Hi</logic:iterate>
> </logic:present>
>
> this code here with teh iterate tag does not it gives me the
> following
> error:
>
> javax.servlet.jsp.JspException: Cannot create iterator for
> this collection
> at
> org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTa
> g.java:310)
> at _search._jspService(search.jsp:96)
> [/search.jsp]
>
> I have these 2 code fragments in the same JSP right next to
> each other,
> I tested by removing one fragment at a time. Any pointers
> would be greatly appreciated.
>
> thanks in advance
>
> troy
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]