File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes problem with logic:iterate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem with logic:iterate" Watch "problem with logic:iterate" New topic

problem with logic:iterate

Jim Colwood

Joined: Jul 10, 2007
Posts: 10

i am trying to iterate list of lists using nested logic:iterate on my JSP. following is my code.

i am getting following error message.

Cannot create iterator for this collection

i am using Tomcat 5.5. any ideas friends?


SCJP 6 |
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

"apex coder",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

JavaRanch Sheriff

[Asking smart questions] [About Bear] [Books by Bear]
Jim Colwood

Joined: Jul 10, 2007
Posts: 10
hope this works. sorry for that.
Rashmi Gopinath

Joined: Jul 09, 2007
Posts: 4
You might want to try like this:

<logic:iterate id="dataset" name="datasets">
<bean:write name="dataset" property="title"/>
<logic:iterate id="item" name="dataset" property="items">
<bean:write name="item" property="title"/>

Narendra Kumar Pinnaka

Joined: Jul 05, 2007
Posts: 9
i am using Struts 1.1.
i have list of dto. in jsp i have to display the dto based on the index

sample java code
int n = 3;

sampleDTO = (SampleDTO)mylist.get(n);

i need to display sample dto

can you please let me know apporiate tag i can use.

thanks in advance
I agree. Here's the link:
subject: problem with logic:iterate
It's not a secret anymore!