Spring Boot使用thymeleaf模板時報異常:template might not exist or might not be accessible by any of the configured Template Resolvers


錯誤如下:

template might not exist or might not be accessible by any of the configured Template Resolvers

解決方法:

1、確定模板是否在默認templates文件夾里面,並且路徑要和返回的View名字一致。

2、new ModelAndView("/log/loglist");這樣寫是不對的,應該把開頭的斜杠去掉,改成:new ModelAndView("log/loglist");

 

參考:

http://blog.csdn.net/linxingliang/article/details/52566941

https://stackoverflow.com/questions/24260520/error-resolving-template-pages-template-might-not-exist-or-might-not-be-acces


免責聲明!

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



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