I have a form page that has an inputText field that accepts a date. We have a converter that converts the string from the textbox into a Date object (ie. "2011-03-01" to java.util.Date("2011-03-01"") )
If the string is not a date, like "123" then a validation error message will be displayed like "value (123) must be a date".
Currently, in my .properties file, I see:
javax.faces.converter.DateTimeConverter.DATE=value ({0}) must be a date
I need to make this error message more clear by specifying exactly which field must be a date. (As there could be more than one date text fields on the form).
I would like to change it to something like:
javax.faces.converter.DateTimeConverter.DATE=The field "{0}" with value ({1}) must be a date
However, I am unsure how JSF automatically fills in the {0} and {1}. How do I specify my own variables inside the JSF Converter error message?
Note: I have added tried creating my own validator (not to be confused with converter) but it seems that the JSF framework does conversion before validation in its lifecycle.