I don\'t understand why JSR 303 (bean validation) is for the getter methods and not setter? Isn\'t it more logical to put it under setter method since that is the entry poin
Bean Validation is called that way for a reason. It is applied to an initialized bean. So, first off, you initialize it with everything you have, then you pass it(or it is passed explicitly) to the Bean Validation implementation, which will rely on the validation annotations when accessing the fields. In case of Spring MVC validation handling starts at:
result = execVal.validateParameters(
invocation.getThis(), methodToValidate, invocation.getArguments(), groups);
inside MethodValidationInterceptor. From here on, it's passed to validation implementation, in most cases Hibernate.
invocation.getArguments() will contain all the method arguments already initialized with the given values, regardless of validation annotations.