From the course: Spring: Spring MVC
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
@ModelAttribute: Add JSP pages
- [Instructor] Now let's implement a use case using the @ModelAttribute annotation. And what is the use case that we're going to implement, let's look at that. So let's say you are on the home page you're going to click on the login link, that log in link should take the user to the login page. And that login page will have a register user link. When we click on that then we will display the registration page for the user and then we can do the rest of the flow from the registration page. So for that the steps begin with adding login.jsp and register.jsp to the project. So in your resources folder, you already have those available with you. So let's go to the resources folder. So register.jsp and login.jsp, both of them let's copy and come back to IDE and paste them under the jsp folder. So we have the login and the register.jsp both available now as a part of the project. Next is you have to add a route in HomeController…
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
-
-
-
-
Basic annotations for controllers4m 20s
-
Create a controller with request mapping4m
-
@RequestParam in Controller5m 37s
-
Add database code3m 7s
-
Access data from Model8m 15s
-
@ModelAttribute: Add JSP pages4m 55s
-
@ModelAttribute: Access model attributes on JSP6m 7s
-
@ModelAttribute: Add Spring form tag library5m 15s
-
Test the application6m 37s
-
-
-
-
-
-
-
-