It's relatively trivial to modify the way dates are formatted when they are bound to form fields with Spring. Just implement the initBinder method in your controller. Here's an example.
{
super.initBinder(request, binder);
binder.registerCustomEditor(Date.class,
"estimatedCompletionDate",
new CustomDateEditor(new SimpleDateFormat( "M/d/yy"), true)
);
}

tagged with:
Leave a comment