问题描述:

We have a rest application based on jersey and hibernate for bean validation which gets triggered by javax.validation.Valid @Valid

annotation.This will validate all the fields that is configured with a constraint.

Now we are looking to implement conditional validation where validate only specific fields when a specific operation is called and have tried org.springframework.validation.annotation.Validated @Validated(<<Group.class>>)

But the problem is the hibernate validation is not getting triggered through the @Validated annotation.

Please let me know if any solution available for the problem

services.xml

<bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"/>

<bean class="org.springframework.validation.beanvalidation.MethodValidationPostProcessor"/>

Pom.xml

<hibernate-validator.version>5.2.4.Final</hibernate-validator.version>

<spring.version>4.2.4.RELEASE</spring.version>

相关阅读:
Top