Friday, 3 December 2010

Spring MVC JSR 303 Empty Strings

/**
* Ensures empty strings come in as NULL's
*
* @param binder
*/
protected void initBinder(final WebDataBinder binder) {
binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
binder.registerCustomEditor(Date.class, new StringTrimmerEditor(true));
}

No comments:

Links