close

Filter

loading table of contents...

Content Application Developer Manual / Version 2207

Table Of Contents
4.3.6.3.4 Presenting form errors

The Spring form tag lib contains tags to display global or field specific error messages:

<%@ taglib prefix="form"
           uri="http://www.springframework.org/tags/form" %>

<form:form method="POST"
           action="handlerUri"
           commandName="nameOfForm">

  <%-- render global error message if available --%>
  <form:errors cssClass="notification error"/>

  <%-- render form fields with
    specific error messages, if available. --%>
  <form:input path="email"/>
  <form:errors path="email" cssClass="notification error"/>

  <form:input path="emailRepeat"/>
  <form:errors path="emailRepeat" cssClass="notification error"/>

  <input type="submit" value="Subscribe"/>
</form:form>

See <form:errors> tag documentation.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.