This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Struts and the fly likes How to get object from Valuestack and pass it to another action? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to get object from Valuestack and pass it to another action?" Watch "How to get object from Valuestack and pass it to another action?" New topic
Author

How to get object from Valuestack and pass it to another action?

Davie Lin
Ranch Hand

Joined: Aug 05, 2007
Posts: 294
I have an employee object on ValueStack and I know it's there because in menu.jsp



is displaying properly, so how do I pass this employee to another action?

I have



and confuse on what to put for value attribute, anything in "" will be interpreted as String, and I get noSuchMethod exception

setEmployee(Ljava.lang.String) I have setEmploye(Employee employee) instead. I didn't think I need a EmployeeTypeConverter class because I want to take the current Employee object from ValueStack not instantiate another Employee object.

any suggestion is appreciated
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You can't pass "an object" as a URL parameter--the only thing HTTP passes in URLs or form submissions is strings.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to get object from Valuestack and pass it to another action?
 
jQuery in Action, 3rd edition