aspose file tools*
The moose likes Struts and the fly likes Issue in submitting the Form with Arraylist in Struts 1.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Issue in submitting the Form with Arraylist in Struts 1.1" Watch "Issue in submitting the Form with Arraylist in Struts 1.1" New topic
Author

Issue in submitting the Form with Arraylist in Struts 1.1

Kiran Chintha
Greenhorn

Joined: Jul 25, 2009
Posts: 15
Hi,
I am using Struts 1.1 for my application.
I have a list of text boxes in my Jsp Page. While pulling the data from the database, i am able to display the required data in the textboxes. But, when i update data in the text boxes and submit the page, the updated data is not available in the action class, nor even updating the data in the database. I have tried to print the data from each text box after updating it and submitting the page, but the old data is only printed from the textboxes. Why the updated data in the jsp page is not set in the Form bean. Am I missing something in this flow, which is causing this issue, Kindly help me out, i am trying to resolve this issue since yesterday, but of no use till now.

Thanks in Advance.
Kiran
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
How are you trying to access the value of the textboxes in your action class, do you have a form bean with attributes that match the textboxes names or so?


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Kiran Chintha
Greenhorn

Joined: Jul 25, 2009
Posts: 15
yes, i do have the form bean with attributes matching the textbox names, but eventhough the changed values are not getting updated.
Kiran Chintha
Greenhorn

Joined: Jul 25, 2009
Posts: 15
Overall, i have three arraylists and each arraylist have multiple text fields (i.e., a text field for each element in JSP).
I have a model class, in which there are setters and getters for each element in the JSP.
And for each arraylist I have setters and getters in the form bean class.
vipul bondugula
Ranch Hand

Joined: Oct 14, 2010
Posts: 218
Hi Kiran,
Please keep System.out.prinln("") statements in your form bean constructor and your setter methods..By this you will come to know whether data is populating for form bean or not..


Thanks
Vipul Kumar
Rajagopal Mani
Ranch Hand

Joined: Mar 24, 2011
Posts: 84

can you please share all the related files including struts-config.xml?
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1

Corresponding to a textfield in the HTML FORM you should be having a String in your Form Bean. No matter what logic you use to populate the textfields initially Struts would look for a String member in your FormBean to store the field value on form submission.

Do post your struts-config.xml.

Cheers,
Raj.
 
wood burning stoves
 
subject: Issue in submitting the Form with Arraylist in Struts 1.1