bean validation - How to access field value in a JSR-303 message? - Stack Overflow
With BeanValidation 1.0 I think there is a way to get the value using a message interpolater. I believe with the hibernate implementation of bean validation 1.0 this was available as part of their bundle.
With BeanValidation 1.1 this became available via EL expressions. The field value is now accessible via the name validatedValue. If you could try to use the latest version. Your message would look like this:
name.size=The name '${validatedValue}' is invalid, its size must be between {min} and {max}Read full article from bean validation - How to access field value in a JSR-303 message? - Stack Overflow
No comments:
Post a Comment