解決WARN:Cannot find template location: classpath:/templates/


SpringBoot 項目啟動后,在控制台有一個WARN

WARN 14516 --- [main] ion$DefaultTemplateResolverConfiguration : Cannot find template location: classpath:/templates/ (please add some templates or check your Thymeleaf configuration)

原因:

  templates 文件夾下沒有html,jsp或者ftl文件

解決方案:

  (1)在/src/main/resources/templates 目錄下添加

    模板文件(后綴為html,.jsp 或 .ftl 的文件)

  (2)在配置文件 application.properties 中添加

spring.thymeleaf.check-template-location=false

問題解決

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM