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

SpringBoot项目使用Thymeleaf报错问题解决

控制台报错信息: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>

相关文章:

  • 2021-09-04
  • 2022-12-23
  • 2022-03-02
  • 2021-06-11
  • 2022-12-23
  • 2021-11-27
  • 2021-04-15
  • 2021-11-10
猜你喜欢
  • 2021-11-17
  • 2021-07-11
  • 2021-10-09
  • 2022-12-23
  • 2022-02-15
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案