This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Making a bean collected from a collection in a page, available in a subsequent page 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 "Making a bean collected from a collection in a page, available in a subsequent page" Watch "Making a bean collected from a collection in a page, available in a subsequent page" New topic
Author

Making a bean collected from a collection in a page, available in a subsequent page

Gregory Vandenbroucke
Greenhorn

Joined: Apr 30, 2004
Posts: 1
Hi all,
I've been looking for a way to make a bean I collected in a jsp page (using logic:iterate) available in a linked page (the links a created in the logic:iterate tag). I've tried to use the bean tag "define", I've tried to use paramId, etc. from the "link" html tag but I can't collect the bean in the linked pages.
My jsp code looks like this:

Depending on which link was clicked I would like to make the corresponding user bean available in the next page. Is this possible? And how do I collect the user bean in the clicked page, if it is possible?
TIA,
Greg
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4447
    
    5

Assuming:
- the user's login property is unique,
- userDetailForward.do is associated with an ActionForm that has
a field named userlogin
you would change the link tag to:

Note that paramName should be the same value as what you specified for the logic:iterate id attribute.
In the receiving action, you can then use the submitted userLogin value to initialize a bean that you can make available to the next page, although you'd normally just pre-populate the ActionForm to be displayed with whatever detailed data you look up using the submitted userLogin value as the key.
[ April 30, 2004: Message edited by: Junilu Lacar ]

Junilu - [How to Ask Questions] [How to Answer Questions]
 
jQuery in Action, 2nd edition
 
subject: Making a bean collected from a collection in a page, available in a subsequent page
 
Similar Threads
Attempted a bean operation on a null object.
Jsp and database using the logic:iterate tag
logic:iterate
logic:present not working??????
bean value persists on clicking back