thymeleaf使用总结
一、引入外部文件
在某个标签中使用th:fragment属性定义一个变量名:
th:include 引入到标签内部,并替换该标签的内部所有内容;
th:substituteby 引入的部分替换该标签以及该标签的所有内容;
二、script中不能识别>,<,&&等特殊字符时
// <![CDATA[
...Your script, here
// ]]>
三、获取工程路径
四、基本语法
1. 遍历
2. 处理enum
3. list长度
五、日期格式化
<dd th:text="${#dates.format(product.availableFrom, 'yyyy-MM-dd HH:mm:ss')}"></dd>
转载于:https://my.oschina.net/dslcode/blog/1590530