error by

Servlet.service() for servlet [dispatcherServlet] in context with path [/testweb] threw exception [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: Error resolving template [/mem/prof/view], template might not exist or might not be accessible by any of the configured Template Resolvers] with root cause
org.thymeleaf.exceptions.TemplateInputException: Error resolving template [/mem/prof/view], template might not exist or might not be accessible by any of the configured Template Resolvers
    at org.thymeleaf.engine.TemplateManager.resolveTemplate(TemplateManager.java:869)
    at org.thymeleaf.engine.TemplateManager.parseAndProcess(TemplateManager.java:607)
    at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1098)
    at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1072)
    at org.thymeleaf.spring5.view.ThymeleafView.renderFragment(ThymeleafView.java:366)
    at org.thymeleaf.spring5.view.ThymeleafView.render(ThymeleafView.java:190)
    at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1373)
    at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1118)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1057)

 

1. CHECK thymeleaf prefix setting : /templates/ (我的是這個)

2. CHECK controller return page path:/mem/prof/view (我的是這個)

發現2的setting 開頭多了一個斜線 組合起來會變成 /templates//mem/prof/view

因此發生異常,

 

算是很低階的錯誤ORZ,將2的return value改為 mem/prof/view 就OK了

 

    咪卡恰比 發表在 痞客邦 留言(0) 人氣()