• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Issue in submitting the Form with Arraylist in Struts 1.1

 
Greenhorn
Posts: 15
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1512
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Kiran Chintha
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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..
 
Ranch Hand
Posts: 84
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you please share all the related files including struts-config.xml?
 
Ranch Hand
Posts: 454
1
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic