org.thymeleaf.exceptions.TemplateInputException: Error resolving template [outbound], template might
使用thymeleaf错误
Error resolving template [outbound], template might not exist or might not be accessible by any of the configured Template Resolvers
Error resolving template [outbound], template might not exist or might not be accessible by any of the configured Template Resolvers
解析模板[outbound]时出错,模板可能不存在,或者任何已配置的模板解析程序都无法访问该模板
Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@79b19d5]
Transaction synchronization committing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@79b19d5]
Transaction synchronization deregistering SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@79b19d5]
Transaction synchronization closing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@79b19d5]
2021-03-25 13:46:19.318 ERROR 11176 --- [nio-8088-exec-1] org.thymeleaf.TemplateEngine : [THYMELEAF][http-nio-8088-exec-1] Exception processing template "outbound": Error resolving template [outbound], template might not exist or might not be accessible by any of the configured Template Resolvers
org.thymeleaf.exceptions.TemplateInputException: Error resolving template [outbound], 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) ~[thymeleaf-3.0.12.RELEASE.jar:3.0.12.RELEASE]
at org.thymeleaf.engine.TemplateManager.parseAndProcess(TemplateManager.java:607) ~[thymeleaf-3.0.12.RELEASE.jar:3.0.12.RELEASE]
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1098) [thymeleaf-3.0.12.RELEASE.jar:3.0.12.RELEASE]
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1072) [thymeleaf-3.0.12.RELEASE.jar:3.0.12.RELEASE]
at org.thymeleaf.spring5.view.ThymeleafView.renderFragment(ThymeleafView.java:366) [thymeleaf-spring5-3.0.12.RELEASE.jar:3.0.12.RELEASE]
at org.thymeleaf.spring5.view.ThymeleafView.render(ThymeleafView.java:190) [thymeleaf-spring5-3.0.12.RELEASE.jar:3.0.12.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1393) [spring-webmvc-5.3.5.jar:5.3.5]
at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1138) [spring-webmvc-5.3.5.jar:5.3.5]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1077) [spring-webmvc-5.3.5.jar:5.3.5]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:962) [spring-webmvc-5.3.5.jar:5.3.5]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) [spring-webmvc-5.3.5.jar:5.3.5]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) [spring-webmvc-5.3.5.jar:5.3.5]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:626) [tomcat-embed-core-9.0.44.jar:4.0.FR]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) [spring-webmvc-5.3.5.jar:5.3.5]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) [tomcat-embed-core-9.0.44.jar:4.0.FR]
解决方法:
在这里我分享一下我解决了bug之后的方法
检查自己的controller,看一下return的路径是否有问题?
再检查一下properties文件的配置是否齐全:
# 配置thymeleaf
spring.thymeleaf.prefix=classpath:/templates/view/ # 对应你的templates路径
spring.thymeleaf.suffix=.html # 对应你的视图后缀
spring.thymeleaf.mode=HTML5
spring.thymeleaf.check-template=true
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.cache=false
spring.thymeleaf.servlet.content-type=text/html
spring.web.resources.static-locations=classpath:/templates/,classpath:/static/
还没有评论,来说两句吧...