Error resolving template [xxx], template might not exist or might not be accessible by any of the

springboot+Thymeleaf

如果查看你的target目录发现templates里的文件并没有全部映射在里面,可以在pom.xml文件的build中:

    <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.*</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources/</directory>
                <includes>
                    <include>**/*.*</include>
                </includes>
                <!-- <filtering>false</filtering>-->
            </resource>
        </resources>

改完运行即可!

你可能感兴趣的:(Error resolving template [xxx], template might not exist or might not be accessible by any of the)