I have a jsp page that is working with the SimpleFormController. Everything works fine, but now I want to display the errors. I get the error message "add the Errors model to your ModelAndView via errors.getModel" when I try to use the tag:
<spring:bind path="uploadCommand.*">
<c:forEach items="${status.errorMessages}" var="error">
Error code: <c:out value="${error}"/><br>
</c:forEach>
</spring:bind>
The problem is I do not have a command object the first time into the jsp page because the user has not entered anything yet. I assume I do not need one version of the form to submit and one to display errors? Or am I supposed to go through a Controller just to set the BindException errors on the model? If so which Controller would I use?


Reply With Quote