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

Custom error page and Login controller

From the course: Spring: Spring MVC

Start my 1-month free trial

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…

Contents