原因:
SpringBoot會自動從/src/main/resources/templates目錄獲取Thymeleaf模板引擎,若該目錄缺失,就會報該警告。
方法1:
創建該目錄
方法2:
在application.yml中加入以下配置:
thymeleaf: check-template: false check-template-location: false
如果是application.properties,就是加入
spring.thymeleaf.check-template=false spring.thymeleaf.check-template-location=false
方法3:
去掉pom.xml中的以下配置:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>