Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

No Format
        <form-bean name="sectionFormsurveyForm"
          type="com.mystuff.myapp.myForm">
        </form-bean>

...

No Format
        <form-bean name="sectionFormsurveyForm"
          type="org.apache.struts.validator.DynaValidatorForm">
          <form-property name="sectionIdsurveyForm"
            type="java.lang.String"/>
          <form-property name="title"
            type="java.lang.String"/>
        </form-bean>

...

  1. It goes and checks for any instances of the form-bean in the scope (the name of the class, type, and scope is specified by the action mapping in struts-config.xml).
  2. If found then call the form's reset method is called.
  3. If not found than a new instance is created and stored in the proper scope.
  4. Then the formBean is populated with request parameters by struts
  5. If the validate is true than the form's validate() method is called. There's no need to call it explicitly and because of ValidatorForm doing all the validation automatically, all that is required for code is a call in your form's submit() method to super.validate(). If you are using DynaValidatorForm, then you will not have program any form beans at all.
    1. if validate() returns any errors, then struts forwards the request to the URL specified in the input attribute of the action mapping.
    2. otherwise it checks for the action which the action mapping is based on.

...