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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies 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.

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: 60041
    
  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: 4419
    
    5

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.
 
Similar Threads
selecting a table row with 3 columns and sending it to another page.
assigning a function's result to a form field
How do I remove quotes from around string a user inputted in text box?
How to select multiple values using JCheckbox
java script