File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
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.

Stas Sokolov
Ranch Hand

Joined: Apr 13, 2004
Posts: 117

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: 61008
    
  65

Moving to the Struts forum.


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

Joined: Feb 26, 2001
Posts: 4456
    
    6

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.