From the course: Spring: Spring MVC

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Add validations to user bean

Add validations to user bean

From the course: Spring: Spring MVC

Start my 1-month free trial

Add validations to user bean

- [Instructor] So let's now do a demo with the JSR validations with Spring MVC. Before we do that, let's quickly see something. Under your external libraries, if you see, you have Javax validation API already included for you. Now this is a specification, which means you need some library which has implemented those interfaces and provided logic. Now that also is available to you as a part of the Spring Boot project. So if you go right down, you see hibernate validator, org.hibernator.validator library. That's the one which is going to provide us with all the necessary implementations from the JSR-380 API. Now please note that hibernate validator is not related to persistence, it is solely an implementation for the javax.validation package that we have as a part of JSR-380. So, let's minimize this, and let's see what steps do we have to carry out in order to do the validations. The first is, we have to insert…

Contents