When working with ConstraintValidators, we just need to define the class and constraint and Spring is able to detect the validators and instantiate them automatically, injecting any beans we ask for in the constructor.
How do I add my custom Spring Validators (https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/validation/Validator.html) in the same manner?
You have to let the controller to know which validator will validate your request. I use following code to find supported validators:
Note that you have to create those validators as beans. Therefore, you should annotate those validators with @Component. Hope this help you.