Get invalid user input with a Spring typeMismatch error
- by TimmyJ
I've implemented a ReloadableResourceBundleMessageSource in my Spring MVC application which I use to display prettier error messages for binding exceptions. The problem I'm having is that, due to a company policy, these errors must be displayed in the following format:
[inputData] is not a valid [fieldName].
The field name is accessible by default in my message properties file (as the {0} argument), but I can't figure out a way to display the invalid user input. Is this possible?