I'm using @Pattern to validate a field:
@Pattern(regexp = Patterns.ZIP_CODE, message="validation.ZIP_CODE")
private String zip;
In my messages.properties file I have this:
validation.ZIP_CODE=Must match NNNNN or NNNNN-NNNN
The javadocs seem to imply that it should look up the validation.ZIP_CODE message:
Returns:
The error message template.
Default:
"{javax.validation.constraints.Pattern.message}"
But instead I get the text:
validation.ZIP_CODE
Am I misunderstanding the javadoc, or am I implementing this incorrectly?