vendredi 20 février 2015

Spring binding errors: display only some messages in JSP

In a JSP I'm listing all the binding/validation errors together:



<ul>
<c:forEach items="${status.errorMessages}" var="error">
<li><c:out value="${error}"/></li>
</c:forEach>
</ul>


However, I have some custom behavior and would like to ignore all the "typeMismatch" errors. Is there a way to do something like the following?



<c:if test="${not error.isTypeMismatch}">
<li><c:out value="${error}"/></li>
</c:if>


Since ${error} is just a plain old String, I don't know how I could determine something like this.


Thanks for your ideas!


Aucun commentaire:

Enregistrer un commentaire