I'm currently working on a small project trying to get Java spring validation working on a web form. It does work, however I have one input for inputting age, which I then convert to number format using this annotation, if I input letters it causes this to be displayed next to the input box when the form is submitted:
"Failed to convert property value of type java.lang.String to required type java.lang.Integer for property age; nested exception is org.springframework.core.convert.ConversionFailedException: Unable to convert value "dasdf" from type java.lang.String to type java.lang.Integer; nested exception is java.lang.IllegalArgumentException: Unable to parse dasdf"
Is there any way to change this message, I'm sure it's simple, but have searched and can't find it.
This is the validation code currently:
@NotNull
@NumberFormat(style = Style.NUMBER)
@Min(1)
@Max(110)
private Integer age;
Cheers, David