aspose file tools*
The moose likes Struts and the fly likes Struts. How to submit ID of the selected object. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts. How to submit ID of the selected object." Watch "Struts. How to submit ID of the selected object." New topic
Author

Struts. How to submit ID of the selected object.

Stan Sokolov
Ranch Hand

Joined: Apr 13, 2004
Posts: 120

I have table in JSP page that shows all users available in the system. I want to submit user_id of selected user to another Action. How can I do this ?


Good luck for yourself.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

Moving to the Struts forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 5274
    
  10

One common approach is to use a link. Assuming you have a User bean in some scope:

//
// attribute name: "userBean"
// bean: instance of User, and User.getUserId() == 1
//

<html:link action="myAction" paramId="id" paramName="userBean" paramProperty="userId">Link to other action</html:link>

This would render

<a href="myAction.do?id=1">Link to other action</a>


Junilu - [How to Ask Questions] [How to Answer Questions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts. How to submit ID of the selected object.