I have created a User domain with not null fields.
If i remove following javascript validation on submit.
Server side validation for notNull attribute doesn't work. On save user is created without validation error.
Am I missing something over here ??
1st of all spring-roo is not to blame for this, spring by default uses java property editor for String which converts it to empty string if no value is provide.
Springs own StringTrimmerEditor can be used inside controllers as shown below.
@InitBinder public void initBinder(WebDataBinder binder) { binder.registerCustomEditor(String.class, new StringTrimmerEditor(Boolean.TRUE)); }