jonmor
Feb 7th, 2006, 01:03 PM
I have a CustomDateEditor registered via initBinder(), but what I can't work out (although I'm sure it must be obvious and I'm just having a stupidity day) is how, within my validator, I trap any exceptions the CustomDateEditor might throw in its attempts to parse the input. For example, when I submit a form containing an invalid date, this is what ends up in my errors object for display on the form the user ends back at:
'Failed to convert property value of type [java.lang.String] to required type [java.sql.Date] for property 'betDate'; nested exception is java.lang.IllegalArgumentException: Could not parse date: Unparseable date: "29/01/tt"'
Obviously what I want is to trap this error and display a more useful message but I must have missed how I do this.
'Failed to convert property value of type [java.lang.String] to required type [java.sql.Date] for property 'betDate'; nested exception is java.lang.IllegalArgumentException: Could not parse date: Unparseable date: "29/01/tt"'
Obviously what I want is to trap this error and display a more useful message but I must have missed how I do this.