I want to combine Hibernate and Spring Validators. I came across this link: http://www.mkyong.com/spring-mvc/combine-spring-validator-and-hibernate-validator/
And it is working as expected. However to get it to work have to comment out InitBinder, enter the method and throw an exception within method itself if there are errors in the BindingResult. I would prefer for it to be like @Validated where it throws the exception prior to even entering the method
@Validated is for Spring and throws MethodArgumentNotValidException if any errors come up. Is there a way to use invoke Hibernate validate as part of Spring Validator class or call both and bind them to the same Result
Came across the above classes: Adapter that takes a JSR-303 javax.validator.Validator and exposes it as a Spring Validator while also exposing the original JSR-303 Validator interface itself.
This solved the issue. I created a SpringValidatorAdapter bean and am injected it into my Spring Validators and calling validate on the object