From the course: Spring Web MVC 6

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Test the bean validation flow

Test the bean validation flow - Spring Tutorial

From the course: Spring Web MVC 6

Test the bean validation flow

- So just to recap of whatever we have done by far, we added the user controller, added two methods. One for displaying the registration form, the other to save the user data. Then we have a user bean in which we have defined properties and also the constraints for validation along with the error messages. And then the register user HTML where we have bound the properties and also inserted tags to display the error messages, if any, for the particular field. So let's run this flow and find out if everything runs well. And let's go to the home URL first and let's click on the user icon. So that's the registration form. I will not enter anything here and just click on the submit button. There we go. We have all the validation messages right there. Email can't be empty. The email can't be empty, the name can't be empty. The size for the name has to be between one and 20. Gender can't be empty. Date of birth can't be…

Contents