I tested Thymeleaf and I have a problem, because when I go to localhost and see my html view, dont see my "Test" value, which should be display on the website. This is my code:
@Controller
public class DisplayData {
@RequestMapping("/display")
public String display(Model model){
model.addAttribute("now", "Test");
return "index.html";
}
}
html view:
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset=”utf-8″>
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
Now is: <b th:text="${now}"></b>
</body>
</html>
Path to index.html file is: resources/static/index.html
And localhost view: index.html
"index"instead of '"index.html"`. In thymeleaf you normally dont need the file suffix.(in default)