From the course: Spring: Spring MVC

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

@ModelAttribute: Add Spring form tag library

@ModelAttribute: Add Spring form tag library

From the course: Spring: Spring MVC

Start my 1-month free trial

@ModelAttribute: Add Spring form tag library

- [Teacher] Now, the next step is to add the Spring form tag library to the project's GSPs. Now, Spring provides a comprehensive tag library for all the data binding of our tags that we need to embed as a part of HTML. So we can just go and Google that, "spring form taglib," and if you see on the official documentation, you should be able to get the taglibs in text in order to put it on GSP. There we go. So I'm just going to copy this. Come back to IDE. Let's go to the register page. And let's put it at the top there. So, we have the form tag library embedded on the GSP page, and now, we are basically going to derive all the tags for the form that we have on this register.GSP from this taglib. So let's go down there and start putting in all the attributes, and that, I believe, is the next step, so you have to convert all the HTML form elements to the Spring form tags. So let's do that. So the first is the prefix…

Contents