File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2.0, persist data across requests

Deepak Srivastav
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have a class TestAction which has two action methods.

class TestAction {
List<Item> items = new ArrayList<Item>();
// getter and setter methods for items

public String execute(){
//populate items

public String modifyItems(){
//modify items on the list

when I call execute, i populate.
In my next request, i call modifyItems(), and this should modify the item list.

Currently, we are storing the list onto the session in the execute() method and retrieveing in the modifyItems() method.

Is there anything in struts 2.0 using which i can achieve the same?

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic