》这个就很像之前prefix和suffix属性,会为我们返回的字符串进行拼串
之前我们前缀实在WEB-INFO下面,后缀是jsp,现在只是换了个模板引擎而已,而且人家前后缀都给你配好了;如果你html没有设计thymeleaf的表达式和标签等,其实返回的就是一个没有渲染的静态页面。
一.ThymeLeaf语法
示例:
”th:html属性“和原生html同时存在并有值,th会覆盖掉原生属性
》thymeleaf支持的表达式
(1)${}实际根据OGNL来获取值和调用方法等的
(2)*{}和${}在功能和使用前上基本是一样的,但它有一些特别的功能。比如下面的th:object会保存一个对象供内部使用
(3)#{},@{}