0

E.g. let's say I had a domain class, a custom validator, and a controller kind of like this:

public class MyDomain { /*Stuff that I want to validate*/ } public class MyValidator extends LocalValidatorFactoryBean { /*Custom Validation Logic*/ } @RestController public class myController { @RequestMapping(path = "/myDomain", method=RequestMethod.POST) public void doStuff(@RequestBody @Validated MyDomain myDomain){ //Do stuff. } } 

How do I make it so that when validation happens on @Validated MyDomain myDomain that MyValidator is used?

Also, can I use a subclass of org.springframework.validation.beanvalidation.LocalValidatorFactoryBean for this or do I need to implement org.springframework.validation.Validator?

9

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.