From the course: Spring Web MVC 6
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Access model attributes on Thymeleaf UI - Spring Tutorial
From the course: Spring Web MVC 6
Access model attributes on Thymeleaf UI
- [Instructor] Now that we have connected all the layers, the product controller, to the fragments and the product repository, the last bit that remains is getting the products on the search results page and displaying them. So let's go and open our search-results.html, this one. And this is in the pure HTML form. So first, we'll have to Bootstrap it with Thymeleaf namespace. So I'll go to fragments.html, copy this namespace on line number 2, and come to the search-results page and insert it. So now we are ready to start using Thymeleaf tags here. Next, we have the head section here, let that be as is. We have the header section under the body. That we will replace by the fragment again to make it consistent with all our other templates. So this is something that we know by now. So we are replacing this with the header fragment from the fragments.html. This is the main section which we'll look at in a minute. And…
Contents
-
-
-
-
MVC controller annotations2m 31s
-
(Locked)
Create a Controller and Java bean for the search function6m 57s
-
(Locked)
Add a repository API to retrieve data from DB5m 48s
-
(Locked)
Connect UI, controller, and data access code5m 6s
-
(Locked)
Access model attributes on Thymeleaf UI11m 9s
-
(Locked)
Add a search string on the UI3m 21s
-
-
-
-
-
-