• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not able to persist my arrayList in Struts2

 
Shyam Sampath
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have recently started using Struts2. I have a jsp which iterates through an ArrayList of JavaBeans. And the jsp has some form fields for user input. The input data is stored in Arraylist as beans. As and when the user inputs data it ll displayed as rows one below the other. The problem I am facing is that I am not able to persist the arraylist, i.e. when the first data is entered it works fine. But when the second data is entered it replaces the first one instead of getting appended with it. I tried making the ArrayList hidden, but no luck. Could any one of you please help me with this issue?

I have attached the code for your reference.


This is my JSP



This is my action class




Thanks
Shyam
 
Joe Ess
Bartender
Posts: 9295
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll have to look into using indexed properties.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic