on-internet
← Community

BindingResult.rejectValue does not find value from ValidationMessages.properties

Stack Overflow ·

We're using spring with annotations, and our annotated fields get validated fine and error messages get displayed from ValidationMessages.properties, but for custom validation message from ValidationMessages.properties does not seem to be used. Here's the example: Validatior (also the form): public void validateSpecial(BindingResult result) { if(password != null && !password.equals(passwordConfirm)){ result.rejectValue("passwordConfirm", "emailform.passwordConfirm.passwordsDontMatch", new Object[]{}, "This message is in the code."); ... } ValidationMessages.properties: ... emailform.passwordCo

Comments

Sign in or sign up to comment and upvote.

No comments yet.