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.
Custom error page and Login controller
From the course: Spring: Spring MVC
Custom error page and Login controller
- [Instructor] So, now let's do some exception handling in out Hplus application. We are going to make the login flow work. What I mean is if you go to the browser, this is our homepage, and when I click on login then I get the login page display. So, I can enter the username and password here and click on login, and this flow is something that we're going to set up as a part of this demo. So, once we set up that login flow, then we are going to make sure that we transact against the database, find out if the user is present in the database. If not, then we will throw in exception. So, that's how we're going to simulate the exception, and that exception then has to be managed by the exception handler that we're trying to implement as a part of this demo. What's the first step? Add the "error.jsp" in the JSP folder for /error mapping. What this means is by default, Spring Boot provides you a /error handler mapping…
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)
-
-
-
-
-