wood burning stoves 2.0*
The moose likes Struts and the fly likes logic:iterate tag displaying same results?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "logic:iterate tag displaying same results??" Watch "logic:iterate tag displaying same results??" New topic

logic:iterate tag displaying same results??

Mona Tajik

Joined: Apr 27, 2006
Posts: 11
hello all

I'm fairly new to struts and i'm having this problem with logic:iterate tag please help!!

I have this in my JSP

This is in my Action Class

My ActionForm bean UserForm has a getter and setter method

The output I have in JSP are
2 user_account_2
2 user_account_2

but it should be
1 user_account_1
2 user_account_2

Any ideas?
Dom Lassy
Ranch Hand

Joined: May 05, 2006
Posts: 181
You are putting the same object into your collection twice. It should look like this:

[ June 05, 2006: Message edited by: Dom Lassy ]
Mona Tajik

Joined: Apr 27, 2006
Posts: 11
Oh ok now I get it. Thanks a lot for the immediate response
Manhar Puri
Ranch Hand

Joined: Aug 23, 2005
Posts: 41
even this should work.

Vector user_info = new Vector();
UserForm userForm = new UserForm(); //ActionForm bean
jQuery in Action, 2nd edition
subject: logic:iterate tag displaying same results??
Similar Threads
Struggling with this - pls HELP!...
No getter method for property: "userName" of bean: "result"
Iterator and multibox
Dynamic radio buttons matrix using Struts
how to handle multiple iterates for the code