Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts. How to submit ID of the selected object.

 
Stan Sokolov
Ranch Hand
Posts: 120
Hibernate IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the Struts forum.
 
Junilu Lacar
Bartender
Posts: 7466
50
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic