O'Reilly logo

Spring MVC Beginner’s Guide by Amuthan G

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Custom validation with JSR-303 / bean validation

In the previous Time for action section, we learned how to use standard JSR-303 bean validation annotations to validate the fields of our domain object. This works great for simple validations, but sometimes, we need to validate some custom rules that aren't available in standard annotations. For example, what if we need to validate that the newly added product ID is not the same as any of the existing product IDs? To accomplish such kinds of validations, we can use custom validation annotations.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required