Versions Compared

Key

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

...

If any errors have been added the then Struts 2 will not proceed to call the execute method. Rather the Struts 2 framework will return "input" as the result of calling the action.

...

Code Block
Java
Java
addFieldError( "personBean.firstName", "First name is required.")

will cause the message "First name is required" to be displayed above the firstName field on the form.

If you have made the above changes to the Processing FormForms tutorial or you have downloaded from Google Code either the Form_Validation_Struts2_Ant or Form_Validation_Struts2_Mvn projects run the application (see the README.txt in the project root folder). Click on the Please register link. On the registration form, just click the submit button and you should see:

...