An error happened during template parsing (template: “class path resource (已解决)
问题描述再用模板引擎Thymeleaf对页面进行渲染时,500报错且后台报错如下ERROR 10296 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw excepti
·
问题描述
再用模板引擎Thymeleaf对页面进行渲染时,500报错且后台报错如下
ERROR 10296 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates/front_end/blog-list.html]")] with root cause
怎么想都想不明白,后来实在是头疼,决定用笨方法一个一个试,最后找到问题所在
解决:组件文件不可以和页面文件放在同一个子目录下
- 可以放在templates总目录下的共同位置。
- 可以放在同一个目录下的不同子目录。
- 可以放在不同目录下的不同子目录。
不可以放在同一个目录下的不同子目录。
更多推荐
已为社区贡献3条内容
所有评论(0)