The validate method in the LoginForm class is called when the Form is submitted. If any errors are found then the control is returned back to the input page where the errors are displayed to the user. The input page is configured in the action tag of strut-config file. <html:errors /> tag is used to display the errors in the jsp page.
<struts-config>02. <form-beans>03. <form-bean name="LoginForm" type="com.vaannila.LoginForm"/>04. </form-beans>05. 06. <action-mappings>07. <action input="/login.jsp" name="LoginForm" path="/Login" scope="session"08. type="com.vaannila.LoginAction">09. <forward name="success" path="/success.jsp" />10. <forward name="failure" path="/failure.jsp" />11. </action>12. </action-mappings>13.</struts-config>