Hi all. I'm using Oval for all my validation and I'm evaluating Hibernate Validation 4 as a possible replacement, as it's jsr-303 compliant and all. It seems Hibernate Validation 4 (or the bean-validation jsr-303 for that matter) is missing one convenient feature of Oval, namely the implicit variables {context} and {invalidValue} which may be used in error-messages.
Say I have this annotation in Oval:
@Length(min = 5, max = 10)
private String code;
The I can have an error-message like this:
net.sf.oval.constraint.Length.violated={context} is not between {min} and {max} characters long. Invalid value is {invalidValue}.
From the Oval-docs:
Quote:
There exist two default variables that can be used in the message string:
- {context} = the validation context (e.g. a field, a method return value or a constructor/method parameter
- {invalidValue} = the value that has been checked
I'm missing the {context} and {invalidValue} variables from Oval. Anyone know how to get the equivalent in Hibernate Validation 4?