This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes How Do I Update An ArrayList in an ActionForm? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How Do I Update An ArrayList in an ActionForm?" Watch "How Do I Update An ArrayList in an ActionForm?" New topic
Author

How Do I Update An ArrayList in an ActionForm?

amchi gelo
Ranch Hand

Joined: Jul 01, 2002
Posts: 75
Hello,

I have an ActionForm bean that contains an ArrayList of records that I display in a JSP file using the <logic:iterate> tag. My problem is these records are updateable fields, so how do I code it so that it catches the changes? As of now, the setter for the ArrayList is not called at all, so there is no update and it remains stuck at the previous values. I have a workaround where I get the values from the request in the Action class and update the ArrayList there. How do I do it in a more Struts way?

Sanjay


Sun Certified Web Component Developer 1.4<br />Sun Certified Java Developer 1.4<br />IBM Certified Associate Developer - WebSphere Studio, V5.0 (285)<br />IBM Certified Specialist - IBM WebSphere Application Server, Adv Single Server Edition for Multiplatforms, V4.0 (158)<br />IBM Certified Solutions Expert - IBM Websphere Studio V4.0 (487)<br />IBM Certified Specialist - IBM Visual Age for Java V4.0 (283)<br />Sun Certified Java Programmer 1.2
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Just use the <logic:iterate> tag in combination with <html:text> or other input tags. The link below shows how to do this.

http://struts.apache.org/faqs/indexedprops.html


Merrill
Consultant, Sima Solutions
 
 
subject: How Do I Update An ArrayList in an ActionForm?
 
Similar Threads
checkbox, arraylist
Sorting Arraylist
Can one action be mapped to more than one ActionForm?
Array List - How Do I?
Pagination