Normally one includes the following in a JSP to diplay all binding error for a given command bean.
However I'd like to move this out of each JSP into a Sitemesh template so I was wondering if there was a way to display all binding errors, without knowing the "command" name that was used in each JSP.Code:<spring:bind path="command.*"> <c:forEach var="error" items="${status.errorMessages}"> <p><font color="red"><c:out value="${error}"/></font><p> </c:forEach > </spring:bind>
Although the snippet below where I specify path="*.*" does not work with Spring, I would like to get the equivalent results.
Code:<spring:bind path="*.*"> <c:forEach var="error" items="${status.errorMessages}"> <p><font color="red"><c:out value="${error}"/></font><p> </c:forEach > </spring:bind>
I could use scriptlets and manually search for request attributes starting with "org.springframework.validation.BindException. " but was wondering it there was a more elegant way.
Thanks,
Sanjiv


Reply With Quote