aspose file tools*
The moose likes Struts and the fly likes re: passing a collection between struts2 actions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "re: passing a collection between struts2 actions" Watch "re: passing a collection between struts2 actions" New topic
Author

re: passing a collection between struts2 actions

terence poh
Greenhorn

Joined: Feb 01, 2011
Posts: 3
Hi Guys, Happy Easter !

I've been trying to solve this for some hours now without success.

I have a jsp form tied to an action, in which a list of objects reside. In the jsp page, I have the user fill in an entry object and post that back to the action. which will add that entry to the object list and then iterate through and render the list of previously entered objects back on the same jsp page.

Now I can shuttle simple properties in between actions easily enough, through the request params etc. but how can I shuttle a large collection object in between actions ? hope I'm not missing something painfully obvious. Any help would be much appreciated.

regards.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8708
    
    6

terence poh wrote: how can I shuttle a large collection object in between actions ?


Either keep it in the session or some other persistent store, like a database.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Robin John
Ranch Hand

Joined: Sep 10, 2008
Posts: 270

why dont you try creating same properties (members) in both action classes and try the "chain" configuration in struts.xml.

I dont understand what exactly you want, if you just want to carry forward to another action or like Joe suggested you want to store it in session ?. any code would also help.


Time is what we want the most, but what we use the worst. -- William Penn
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: re: passing a collection between struts2 actions
 
Similar Threads
accessing jsp directly?
Action Form
flow of servlets
Polymorphism and Method Signatures
Passing objects between actions in struts2