1.thymeleaf依赖
<!-- thymeleaf --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>
2.注意静态资源的加载(templates)
<resource> <directory>src/main/resources</directory> <includes> <include>**/*.xml</include> <include>**/*.properties</include> <include>**/*.yml</include> <include>**/*</include> </includes> <filtering>true</filtering> </resource>
3.配置
thymeleaf: cache: false prefix: classpath:/templates 1.本是默认的地址一般不要加 第一次问题去掉就成功了 2.如果需要加 最后面不要加/ suffix: .html check-template-location: true check-template: true
标签:accessible,templates,might,thymeleaf,template,true From: https://www.cnblogs.com/kidzxy/p/17041709.html