Details
Description
Commonly required ValueConverters are those handling Date and List objects.
Add DateValueConverter and ListValueConverter to o.c.w.bind.converters package, which can optionally be configured in the web.xml like any other ValueConverter.
Both converters are i18n-enabled (for configuration and error messages).
The DateValueConverter message keys and defaults are:
"bind.error.date.missing", "Missing date value for field
"bind.error.date.invalid", "Invalid date {1} (using format {2}) for field {0}
"
"date.format", "dd/MM/yyyy"
The ListValueConverter message keys are:
"bind.error.list.missing", "Missing list value for field
"
The ListValueConverter will also check if the list values are parseable to integers and doubles and if so will return a list of the appropriate types. If not it will return a list of string values.
Refactored converters to return null by default for missing values, but allow behaviour to be overridden to throw a bind exception.