This week's book / license giveaways are in the JDBC and Relational Databases and Java in General forums.
We're giving away four copies each of PostGIS in Action and Java Advanced Topics Training and have the authors on-line!
See this thread and this one for details.
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


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "logic:iterate tag displaying same results??" Watch "logic:iterate tag displaying same results??" New topic
Author

logic:iterate tag displaying same results??

Mona Tajik
Greenhorn

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
Greenhorn

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
userForm.setId("1");
userForm.setDesc("user_account_1");
user_info.addElement(userForm);
userForm.setId("2");
userForm.setDesc("user_account_2");
user_info.addElement(userForm);
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: logic:iterate tag displaying same results??