原因一:在pom文件配置了静态资源加载,删除掉就好
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
原因二:没有配置thymeleaf
spring:
thymeleaf:
check-template-location: true