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

Time for action – adding bean validation support

In this section, you will learn how to validate a form submission in a Spring MVC application. In our project, we have the add products form already. Add some validation to this form by performing the following steps:

  1. Open the pom.xml file—you can find pom.xml under the root directory of the project itself.
  2. You will see some tabs at the bottom of the pom.xml file. Select the Dependencies tab and click on the Add button in the Dependencies section.
  3. A Select Dependency window will appear; enter Group Id as org.hibernate, enter Artifact Id as hibernate-validator, enter Version as 4.3.1.Final, select Scope as compile, and click on the OK button and save pom.xml.
  4. Open the Product domain class and add the ...

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