Skip to main content

Validator

Learn Validator (Validation, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes Validator is the Spring interface org.springframework.validation.Validator that checks an object and records problems in an Errors object. Two methods : supports(Class) says which types it can check, and validate(Object, Errors) does the checking. Use it by registering it in @InitBinder with binder.addValidators(...) or by calling it by hand.

More lessons in Validation