Accessing Errors in JSPs: The html:errors Tag
How does the login page access the error messages to render them in a form?
- Recall that the page
login.jsp is associated with the loginForm bean
- The Struts
tag html:errors accesses the bean and any ActionErrors that
have been set for it
- Here again is the
login form,
this time emphasizing the beginning of the form where any errors appear
- The html:errors tag renders a list in the form containing the
text of any errors
What happens if there are no validation errors?
Then instead of
forwarding to the login page, Struts passes control to an Action class
object.