File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to push ArrrayList in ValueStack" Watch "How to push ArrrayList in ValueStack" New topic

How to push ArrrayList in ValueStack

Khsitiz sharma

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

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:
subject: How to push ArrrayList in ValueStack
It's not a secret anymore!