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

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