model....
@Digits(integer=5, fraction=0, message=\"The value must be numeric and less than five digits\")
private int value;
beans file....
As you mentioned, you need a user-friendly message in messages.properties
. You can use one of the following message codes (with different levels of selectivity):
typeMismatch.section.value
typeMismatch.value
typeMismatch.int
typeMismatch
Also, when you don't know message code, you can simply print the BindingResult
- its toString()
returns the full description of the binding errors.