Skip to main content

Validation Groups

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

Fresher Notes Validation groups let one class have different rule sets by use case, for example create versus update. A group is just an empty marker interface, like interface OnCreate {} . Selecting a group in a controller uses @Validated(OnCreate.class) instead of @Valid .

More lessons in Validation