I'd like to use JSR-303 annotations for parameter validation of methods of a class other than a JAX-RS resources. Using the JEE containers it works on EJB/CDI beans, but I cannot get it running in Spring. The code might look like below.
Which maven dependency or other configuration am I missing? (I don't want to call the Validator
myself. I want spring does the work for me here.)
Note that the Person class is not a JPA entity, hence Hibernate Validator as the implementation of JPA cannot do the work here.
public class Person{
@NotNull
private String firstName;
}
@Service
public class PersonServiceImpl{
public void create(@Valid Person person){
....
}
}