1. 程式人生 > 其它 >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

template might not exist or might not be accessible by any of the configured Template Resolvers錯誤
截圖就不貼了,這句話意思是找不到模板檔案。也就是瀏覽器傳送請求給伺服器時,伺服器根據請求,找不到對應路徑下的檔案。
這種情況有可能你的檔案真的不存在。另一種可能是伺服器解析路徑時有錯誤,也就是說你的檔案確實存在,但是路徑不對。(這裡的路徑不對可能是伺服器解析路徑時沒有解析對,也可能就是你的檔案放路徑時放錯位置了)
總而言之,錯誤還是比較簡單的,告訴瀏覽器正確的檔案位置就好了。如果是SpringBoot專案,出這個問題的原因可能是因為你配置themylef作為模板檔案,但是pom.xml檔案中沒有引入依賴,導致SpringBoot框架解析路徑位置時沒有解析對,所以只要新增上依賴就可以解決了。

 <dependency>
            <groupId>net.sourceforge.nekohtml </groupId>
            <artifactId>nekohtml </artifactId>
            <version>1.9.22 </version>
 </dependency>