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.

Default model attributes using @ControllerAdvice

Default model attributes using @ControllerAdvice

From the course: Spring: Spring MVC

Start my 1-month free trial

Default model attributes using @ControllerAdvice

- [Instructor] This video is for a problem that we have already seen in one of our videos before. I'm just going to run through their problem again for you and then you will fix that problem and then move ahead. So, let's go to our application this is H+ and if you click on login, click on Register. Let's say you enter some faulty data, so that the validations fail and say Submit. And if you remember, after the validation messages were displayed, the gender drop-down was empty. And we had mentioned about this problem in that particular video of validations and we said that we will fix this or address this problem at a later part of the course. So now is the time to fix it. What has happened is that when the error messages were displayed on the form again, then the model attribute for this gender fill was not available. If you go back to IDE and if you go to a Home Controller, if you remember, this gender items on line 44,…

Contents