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.
@ModelAttribute: Access model attributes on JSP
From the course: Spring: Spring MVC
@ModelAttribute: Access model attributes on JSP
- [Instructor] The next step in this registration use case will be to add a user.java bean to the project structure. So let's come back to IDE. And under beans, I'm going to create a class, call it user. This again is going to follow the spring data, spring GPA standards. So I'm going to annotate it with @entity. And let's now define the fields for user. So there will be an ID, there will be a string, which is username, then a password. Then we can have the agenda of the user. We can have the activity that user is interested in, maybe playing a sport, going to the gym, etcetera. Then we can also have a first name of course, and we have a last name to go with it. And finally, we are going to tap the users date of birth. There we go all of those fields, I am going to annotate the ID field, on line eight with the ID annotation. Same again, Java Persistence API annotation. And once we're done with that…
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)
Basic annotations for controllers4m 20s
-
(Locked)
Create a controller with request mapping4m
-
(Locked)
@RequestParam in Controller5m 37s
-
(Locked)
Add database code3m 7s
-
(Locked)
Access data from Model8m 15s
-
(Locked)
@ModelAttribute: Add JSP pages4m 55s
-
(Locked)
@ModelAttribute: Access model attributes on JSP6m 7s
-
(Locked)
@ModelAttribute: Add Spring form tag library5m 15s
-
(Locked)
Test the application6m 37s
-
(Locked)
-
-
-
-
-
-
-