I think, that should be trivial (in my case I check that emails are the same):
Code:
final Object email = errors.getFieldValue("email");
final Object emailConfirmation = errors.getFieldValue("emailConfirmation");
if (!ObjectUtils.equals(email, emailConfirmation)) {
errors.rejectValue("emailConfirmation", "required", null, "Emails should match");
}
In JSP:
Code:
E-Mail Address: <form:errors path="email" cssClass="error" /><form:input path="email" size="25" />
Re-enter E-Mail Address: <form:errors path="emailConfirmation" cssClass="error" /><form:input path="emailConfirmation" size="25" />