Hi,
I've searched this forum, the web, and all Spring samples I could find, but didn't find an answer to this simple problem. I have a "change password" screen; the user must enter a new password in field1 and confirm it in field2. I have the following code in a Validator:
and this is the JSP form:Code:public void validate(Object obj, Errors errors) { if (!password1.equals(password2)) errors.reject("changepassword.passwordsnotequal", "no default!"); }
When the passwords don't match, the validate() code is called as expected, and the user is forwaded back to the form, but the output on the form is:Code:<spring:hasBindErrors name="command"> <font color="red"> <c:forEach var="err" items="${errors.globalErrors}"> <tr><td><c:out value="${err}"/></font></td></tr> </c:forEach> </font> </spring:hasBindErrors>
How can I display the message associated with changepassword.passwordsnotequal?Code:Error in object 'command': codes [changepassword.passwordsnotequal.command,changepassword.passwordsnotequal]; arguments []; default message [no default!]
Thank you in advance for any help,
grimholtz


Reply With Quote