template模板找不到


springboot启动时报WARN的警告,
报错内容:Cannot find template location: classpath:/templates/ (please add some templates or check your Thymeleaf configuration)

启动之后,执行访问报错。

上网找了解决方案

<resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                    <!--加载模板文件-->
                    <include>**/*.html</include>
                    <!--加载静态文件-->
                    <include>/static/</include>
                </includes>
                <filtering>false</filtering>
            </resource>
View Code

还没想原理,不过看解决方案应该是被过滤了,按说springboot不是不会过滤自己的templates下的静态文件么?后找时间再了解下


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM