1.检查resource下xml配置路径(没有问题)
2.检查文件存放的路径,templates(需要导入thymeleaf)
3.最后检查thymeleaf的版本
原来的版本是
thymeleaf-spring4,导致的错误
<!--thymeleaf-->
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring5</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-java8time</artifactId>
</dependency>