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

@ModelAttribute: Access model attributes on JSP

From the course: Spring: Spring MVC

Start my 1-month free trial

@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…

Contents