How to include JSR-303 validation annotation's attribute into validation message?
How to include validation annotation's attribute into validation message?
There are snapshots from my application below:
Form Object:
Quote:
...
@Size(min = 6)
private String password;
...
validation.properties:
Quote:
Size.password = Password should be at least {min} characters
Without {min} message is displayed successfully on the page, if {min} is included I get:
Quote:
Caused by: java.lang.IllegalArgumentException: can't parse argument number min
The key word here is "number". If I write Size.password = Password should be at least {2} characters, actually it works, and min value will be displayed (I found this arg number during inspecting BindingResult object after validation is applied in my controller). But this is weird.
What is right configuration for spring web mvc project to able support for validation annotation attribute's values in the message source?
Thank you.