-
Jan 24th, 2013, 03:29 PM
#1
@Valid @RequestBody Does not work
Custom validator is not getting called with following configuration. I don't have <mvc:annotation-driven /> in my xml configuration file. Strange thing is, it gets called for someOtherObj which is being returned.
Spring Framework 3.1.2
Hibernate-Validator 4.3.1
Controller
--------
@InitBinder
protected void initBinder(WebDataBinder binder) {
binder.setValidator(new CustomValidator());
}
public ModelAndView create(@Valid @RequestBody MyObject obj) throws Exception
{
return new ModelAndView("default", "xxx", someOtherObj);
}
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules