That's definitely possible. Spring provides dependency injection support also within constraint validators. So you can simply inject any required services in your custom validators like this.
That's definitely possible. Spring provides dependency injection support also within constraint validators. So you can simply inject any required services in your custom validators like this: public class EmailExistsValidator implements ConstraintValidator { @Inject private EmailValidationService service; @Override public void initialize(EmailExists constraintAnnotation) {} @Override public boolean isValid(String value, ConstraintValidatorContext context) { if (value == null) { return true; } return service.
Exists(value); } } Depending on your concrete scenario it might be a good idea to first check "cheap" constraints such as @NotNull and only if these constraints are valid check more expensive constraints such as @EmailExists. You can do this with help of group sequences and a redefined default group sequence for your type.
I didn't think about @Inject. We'll try that. Thanks so much!
– mrjabba Aug 22 at 19:53.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.