When using the spring:bind tag, ${status.errorMessage} seems to displaying only one error message even if there happen to be multiple errors, at least when I use the tag in this way:
That behavior is fine in some instances. (It's probably enough to print out only one error for an object property.) But there are times when I'd like to be able to display all errors. In fact, I think I'd almost always want to print out all object-level errors-- that is, errors based on an interaction of object properties, as in "A comment is required when price increase is > 30" and "Price reductions require management approval."Code:<spring:bind path="priceIncrease.percentage"> <td width="20%"> <input type="text" name="percentage" value="<c:out value="${status.value}"/>"> </td> <td width="60%"> <font color="red"><c:out value="${status.errorMessage}"/></font> </td> </spring:bind>
So how does one display multiple errors?


Reply With Quote