1.引入依賴html
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>
2.application.properties中添加spring
classpath:/templates/*.html classpath:/static/ #thymeleaf start spring.thymeleaf.mode=HTML5 spring.thymeleaf.encoding=UTF-8 spring.thymeleaf.content-type=text/html #開發時關閉緩存,否則無法看到實時頁面 spring.thymeleaf.cache=false #thymeleaf end
3.OK緩存