Use the following code....

<logic:present name="rows" scope="session">
  <logic:iterate id="row" name="rows" scope="session" 
type="NibuSrchVLocalDTO"> Hi </logic:iterate>
</logic:present>


This will print the "Hi" the number of times depending on the size of 
ArrayList. Also do not forget to use the fully qualified name with package 
for type="NibuSrchVLocalDTO"

Regards,
Rajasekhar Cherukuri




Troy Bull <[EMAIL PROTECTED]> 
10/20/2005 08:56 PM
Please respond to
"Struts Users Mailing List" <user@struts.apache.org>


To
Struts Users Mailing List <user@struts.apache.org>
cc

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(IterateTag.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]


ForwardSourceID:NT00006592 


Notice: The information contained in this e-mail message and/or attachments to 
it may contain confidential or privileged information.   If you are not the 
intended recipient, any dissemination, use, review, distribution, printing or 
copying of the information contained in this e-mail message and/or attachments 
to it are strictly prohibited.   If you have received this communication in 
error, please notify us by reply e-mail or telephone and immediately and 
permanently delete the message and any attachments.  Thank you

Reply via email to