4.4 thymeleaf使用补充

1. 转义字符的使用

th:text="${#dates.format(ruleSeasonalRestrictPo.beforeDate,'yyyy-MM-dd''T''HH:mm:ss')}"

效果:2019-06-28T10:08:32,使用转义字符可以使得时间格式里面的字符T不被当做格式字符而匹配

2. 判断一个对象是否为空,不为空的话获取属性的值

th:if="${ruleSeasonalRestrictPo?.tag == 2}"

猜你喜欢

转载自www.cnblogs.com/shiyun32/p/11101176.html
4.4