In an implementation of Validator an Errors object is provided which you can use to register an error for a field of the command bean (using one of the 'reject*' methods).
I can't seem to figure out how to register an error for a field that Spring does not attempt to lookup in a resource bundle. I've tried both of these:
But in both cases it seems that Spring is trying to use "Month index...." as a key into a resource bundle, because I see the following exception in the logs:
errors.rejectValue("month", "Month index must be between 1 and 12");
errors.rejectValue("month", null, "Month index must be between 1 and 12");
Is there any way to just raise an error for a particular field with an appropriate message, and bypass the lookup in the resource bundle?
javax.servlet.jsp.JspTagException: No message found under code 'Month index must be between 1 and 12' for locale 'en_US'.
Thanks in Advance,