錯誤信息:Exception processing template “/view/df”: Error resolving template “/view/df”, template might not exist or might not be accessible by any of the ...
錯誤信息:Exception processing template “/view/df”: Error resolving template “/view/df”, template might not exist or might not be accessible by any of the configured Template Resolvers
org.thymeleaf.exceptions.TemplateInputException: Error resolving template “/view/df”, template might not exist or might not be accessible by any of the configured Template Resolvers
錯誤描述:再開發環境下,訪問不出錯。打成jar包後運行出錯,經過一番查看,最終找到原因。
特別說明該項目我是用的是Thymeleaf的th標簽。
原因:在控制器中返回的視圖路徑如下,return “/view/df” 修改前,修改為return “view/df” 即可,然後再重新打包訪問,問題解決了。該問題是由於路徑的問題導致的。
參考博客:
https://blog.csdn.net/Lin_xiaofeng/article/details/79122053
https://blog.csdn.net/PubliclyAccessible/article/details/79726360
https://blog.csdn.net/u012613251/article/details/80304722