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

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>

猜你喜欢

转载自blog.csdn.net/Winston_Limf/article/details/81359142