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.