Discussions

Web tier: servlets, JSP, Web frameworks: problem regarding validation of lines in JSP/STRUTS based form

  1. hi ...
     
     I am having a JSP which holds 10 text boxes and an 'addLine' button , if one clicks the button after populating the given text boxes then additional 10 text boxes will be appended. I am using STRUTS framework , and in which the action form i am having 10 set and get methods to hold the values of the textboxes, my question is , upon clicking of 'addline' button 10 new text boxes will get added up , then how to handle the values of the new textboxes in the action form which has only 10 Setter and Getter methods ?

     help required.


     kishore
  2. If these are logical records and you're adding more of them then you should be using indexed properties in your Form Bean, then you'll only have a single getter and setter:
    http://struts.apache.org/userGuide/building_view.html#indexed