使用thymeleaf的include或者是replace報錯,但不使用一切正常時的解決方法之一
阿新 • • 發佈:2021-01-15
技術標籤:問題
如果錯誤是類似
org.thymeleaf.exceptions.TemplateInputException: Error resolving template "usersmanger", template might not exist or might not be accessible by any of the configured Template Resolvers (template: "x/x" - line 67, col 26)
上面的x/x表示的是檔案相對路徑,當你使用include或replace時忘記了檔案的路徑。
<div th:include="~{x/x:: x}" class="hello"></div>
另外檢查是否檔名是否正確。。。。。。。。