andyl
Sep 27th, 2004, 01:00 PM
I have a SimpleFormController which has an initBinder method for dates
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
df.setLenient(false);
binder.registerCustomEditor(Date.class, null, new CustomDateEditor(df, true));
I have added a message for typeMismatch.java.util.Date in my messages.properties.
When I enter a deliberately incorrect date (eg 2004/09/33) I see my message displayed briefly, and then replaced with the "Failed to convert ..." message. If I use the browser's back button I get back to the page with my message displayed.
Why is this occurring and how can I avoid that second message?
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
df.setLenient(false);
binder.registerCustomEditor(Date.class, null, new CustomDateEditor(df, true));
I have added a message for typeMismatch.java.util.Date in my messages.properties.
When I enter a deliberately incorrect date (eg 2004/09/33) I see my message displayed briefly, and then replaced with the "Failed to convert ..." message. If I use the browser's back button I get back to the page with my message displayed.
Why is this occurring and how can I avoid that second message?