This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread 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

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
I agree. Here's the link:
subject: logic:iterate tag displaying same results??