Thymeleaf 常用语法

192 阅读1分钟
  • 热部署设置

在application.properties中加入配置:spring.thymeleaf.cache=false

增加maven的devtools依赖

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <optional>true</optional>
</dependency>
  • 循环
<option th:each="param:${paramDto.resultList}" 
   th:value="${param.paramCode}"
   th:text="${param.paramValue}">
</option>