1、启动项目,访问templates文件夹下的login.html页面,报如下错误:

控制台报错信息:org.thymeleaf.exceptions.TemplateInputException: Error resolving template "login", template might not exist or might not be accessible by any of the configured Template Resolvers。。。
2、问题解决:报错之后在项目中一顿排查,发现是我的pom.xml中的配置导致的,删除如下配置即可:
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**.*</include>
</includes>
</resource>
</resources>
本文介绍了一个关于Thymeleaf模板加载失败的问题及其解决方案。错误出现在尝试访问templates文件夹下的login.html页面时,通过调整Maven项目的资源文件配置解决了该问题。
1109

被折叠的 条评论
为什么被折叠?



