-
Simple binding question
Hi. The following code appears in the web page in case of data binding error.
The question is how can I remove it and instead of it place a (malicious-)user friendly message?
Code:
Failed to convert property value of type [java.lang.String] to required type [org.mayhem.identity.Gender] for property info.gender; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [org.mayhem.identity.Gender] for property gender: no matching editors or conversion strategy found
-
In general how can I supply my own binding error messages?
-
In your resource bundle have a property such as
Code:
typeMismatch.propertyName = My own error message
The error message will be displayed when there is a casting error.
-
What do you mean by "casting error"?
For example I have this enum: Gender {FEMALE, MALE} , and when I supply MAL, instead of MALE, there is no casting error, as defined by the JLS
What I need is an interface which resolves the error messages, for me to supply my own implementation/extension
-
Anyway it works for both cases... Thanks