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