Developing Struts Application With Form Components in the form Page

Developing Struts application With diff. types of form components in the form page:-

Resource of application:-

  1. Details.JSP (form page)
  2. DetailsForm.Java (formbean class)
  3. DetailsAction.Java (action class)
  4. Result.jsp (result page)
  5. Struts-config.xml (Struts config file)

Details.jsp:-

Details From.java:-

 

DetailsAction.java:-

 

Struts-config.xml:-

Result.jsp:-

Deployment Directory

 

  • The select box that allows to select multiple items is called as list box.
  • When items in select box, list box are selected and radio button, check boxes are selected then their labels will not go to server as request parameter values. The values of their respective value attributes will go to server as request parameter values.
  • When check box is not selected, no item of list box is selected then they will not send their request parameters to server. So the related setxxx () methods in form bean class will be not be executed. Whereas the remaining form components send default values (empty Strings) as request parameter values even though they are not filled up with values or not selected.
  • While working with Struts environment of form page having checkbox, list box and of form bean scope is Session scope the following problem may raise. I.e these two components related form bean properties may show selected state values even though they not selected in the form page.

Leave a Reply

Your email address will not be published. Required fields are marked *