aspose file tools*
The moose likes Struts and the fly likes How to push ArrrayList in ValueStack 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 "How to push ArrrayList in ValueStack" Watch "How to push ArrrayList in ValueStack" New topic
Author

How to push ArrrayList in ValueStack

Khsitiz sharma
Greenhorn

Joined: Jun 03, 2008
Posts: 7
Hi Friends
I'm facing a problem in my project where I need to push an ArrayList of DTO's
on ValueStack.
What I want is when user invokes an action say search.action the ArrayList gets populated by DTO's and shown to user. But when I call another action say
update.action the ArrayList becomes null. Both these actions invokes different methods of a class. Moreover I don'nt want to store list in session.

thanks and regards
[ December 11, 2008: Message edited by: Khsitiz sharma ]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

If you don't want to store the list in session then you need to re-create the list.

This can be done in a prepare() method of an action that implements Preparable, so every action method will have the list populated automatically.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to push ArrrayList in ValueStack