This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes sending a list from jsp to action class hidden Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "sending a list from jsp to action class hidden" Watch "sending a list from jsp to action class hidden" New topic
Author

sending a list from jsp to action class hidden

paddy Mahadeva Iyer
Ranch Hand

Joined: Feb 10, 2007
Posts: 63
Hi,

I found that I am not able to forward a list from my jsp to action class.

I have a list "myList" that is populated and send to the jsp from my action class. My jsp needs to forward this to the next action method.

I tried



But this is not working. I tried a few other options also but none helped

any suggestions?

Thanks in advance
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

When a form is submitted the only thing sent to the server is strings: unless the server side knows how to convert these strings into actual objects you'll not get what you expect.

There are several options, including (a) convert the string representation of the list into an actual List and (b) store the list in session scope. S2's type conversion may help with (a), depending on the string representation of the list--which is what you'll get by putting the list into an <s:hidden...> tag.
 
Consider Paul's rocket mass heater.
 
subject: sending a list from jsp to action class hidden
 
Similar Threads
how to call action on click of checkbox?
Select and trigger an action through a link, doesn't populate the value
List not refreshing after submit
Displaying simple read-only tabular data
JSTL - collection in request vs. session