Thymeleaf 使用过程中的一些记录

Thymeleaf格式化时间:

th:value="${#dates.format(gw.regDT,'yyyy-MM-ddHH:mm:ss')}"

Thymeleaf select反选:

<select id="status" name="status" th:field="${gw.status}" th:value="${gw.status}">
    <option  th:selected="${gw.status=='0'}" value="0">请选择</option>
    <option  th:selected="${gw.status=='1'}" value="1">离线</option>
    <option  th:selected="${gw.status=='2'}" value="2">在线</option>
</select>

猜你喜欢

转载自my.oschina.net/u/3658506/blog/1861599