I am trying to build simple search tab with thymeleaf and Spring boot. Here is my codes and html files.
scCountry.html
Was facing a similar problem. This didn't work:
<input type="text" th:field="*{content}">
This did:
<input type="text" field="*{content}" name="content">
th:field="*{sInput.keyWord}"
should be
th:field="*{keyWord}"
When using *{...}
expressions, the th:object
is assumed.
Do the below modifications in your controller and try
@GetMapping(value="/search")
public ModelAndView SearchForm(Model model, SearchInput sInput) {
return new ModelAndView("scCountry");
}
Hope you will get solved your error.