aspose file tools*
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 Spring in Action this week in the Spring 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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sending a list from jsp to action class hidden