vygooglil som zatial toto:
I have some default binding error messages configured for scenarios
where a form values can't be bound. For example, when a string in the
form can't be bound to a Long value. A subset of my messages.properties
looks like:
typeMismatch.java.lang.Integer=Must specify an integer value.
typeMismatch.java.lang.Long=Must specify an integer value.
typeMismatch.java.lang.Float=Must specify a decimal value.
typeMismatch.java.lang.Double=Must specify a decimal value.
takze v resource bundle (messages.properties) staci prepisat tieto
hlasky ako potrebujem. vyskusal som a funguje.
property mam typu Integer.
Ivan
Karel Tejnora wrote / napísal(a):
Jen tak od boku; Tohle se mi stava pri validaci, kdyz property je typu
"int" nikoliv java.lang.Integer (nebo setAge(Integer age) vyhodi vyjimku
NullPointerException)
Failed to convert property value of type [java.lang.String] to required type
[java.lang.Integer] for property age; nested exception is
java.lang.NumberFormatException: For input string: "aaa"