Injecting Spring Dependencies into ConstrantValidator
问题 I'm using Bean Validation. I have a custom validator @MyValidator that needs to look up a value with an injected Spring managed DAO object. How can I get access to this? Spring isn't injecting the DAO into my "MyValidator" object. @Component public class CodeListValidator implements ConstraintValidator<CodeList, String> { @Autowired private ICodeListCommonService codeListCommonService; private CodeListEnum codeListID; @Override public void initialize(CodeList constraintAnnotation) { this