下面说到的在thymeleaf官网上都可以找到,这里只做个总结
2019-04-21 更新
新增一些用法
@GetMapping("/")
public String index(Model model) {
model.addAttribute("name", "hello thymeleaf");
return "index";
}
使用 th:text 属性展示数据
<div th:text="#{name}"></div>
<div th:text="${name}"></div>
<div th:text="@{/about}"></div>
<div>[[${name}]]</div>
区别: