From the course: Spring Web MVC 6
Unlock the full course today
Join today to access over 24,100 courses taught by industry experts.
Add a search string on the UI - Spring Tutorial
From the course: Spring Web MVC 6
Add a search string on the UI
- [Instructor] So we have the search results displayed. Everything is displayed correctly. The last couple of fixes that we need to do is repairing this search string. What we searched for has to get displayed here and then the number of products. So let's go ahead and do those couple of fixes. On the search-results.html, we now have to open this header section on line number 46. I'm going to expand that and that's where you see this. You searched for and it's hard-coded to be blade, so we don't want that. Instead we'll say th:text and access the model attribute that we had already stored, searchedFor. Let's recollect that ProductController has a model attribute added on line number 26, which has the keyword that we were looking for. So that's what I'm accessing on the HTML page on line number 48. In addition to that, I also have five products, so I don't want that. Instead, I will say th:text. I can say…
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
-
-
-
-
-
-