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
From the course: Spring: Spring MVC
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,…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
DispatcherServlet and special bean types3m 12s
-
(Locked)
Exception flow handler implementations4m 33s
-
(Locked)
Custom error page and Login controller4m 1s
-
(Locked)
Add method for selecting a user5m 51s
-
(Locked)
Add exception handler in Controller6m 28s
-
(Locked)
Global exception handler for application4m 52s
-
(Locked)
Default model attributes using @ControllerAdvice4m 27s
-
(Locked)
-
-
-
-
-