f-angi
5/18/2017 - 3:39 PM

Trim binded Strings

Trim binded Strings

@InitBinder
public void initBinder(WebDataBinder binder) {
  // StringTrimmerEditor(true) bind empty Strings to null
  // StringTrimmerEditor(false) keeps empty Strings as they are
  binder.registerCustomEditor(String.class, new StringTrimmerEditor(false));
}