To avoid copying unnecessary code, I want to divide the page into 3 parts, header, content and footer. Previously, I used jsp and just inserted using <%@ include file = "header.jsp"%> Now I want to learn Thymeleaf and I would like to do something like that. And how to use it in the Spring section. Earlier, I made a controller on the similarity:
@RequestMapping(value = {"/", "/welcome"}, method = RequestMethod.GET) public String welcome() { model.addAttribute("Hello", "Hello world"); return "welcome"; } Can I leave it like this, or do I need something else for Thymeleaf? I read about the fragments, but did not understand how to connect it with the controller.