SpringBoot Thymeleaf热加载
时间: 2023-11-19 18:51:12 浏览: 159
要实现SpringBoot Thymeleaf的热加载,可以在pom.xml文件中添加devtools依赖,并在application.properties文件中设置开启热加载的配置。具体步骤如下:
1. 在pom.xml文件中添加devtools依赖:
```xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
<scope>runtime</scope>
</dependency>
```
2. 在application.properties文件中设置开启热加载的配置:
```properties
# 开启热加载
spring.thymeleaf.cache=false
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
spring.thymeleaf.mode=HTML
```
这样就可以实现Thymeleaf模板的热加载了。
阅读全文
相关推荐


















