template might not exist or might not be accessible by any of the configured Template Resolvers
at org.thymeleaf.engine.TemplateManager.resolveTemplate(TemplateManager.java:) ~[thymeleaf-3.0..RELEASE.jar:3.0..RELEASE]
at org.thymeleaf.engine.TemplateManager.parseAndProcess(TemplateManager.java:) ~[thymeleaf-3.0..RELEASE.jar:3.0..RELEASE]
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:) [thymeleaf-3.0..RELEASE.jar:3.0..RELEASE]
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:) [thymeleaf-3.0..RELEASE.jar:3.0..RELEASE]
at org.thymeleaf.spring5.view.ThymeleafView.renderFragment(ThymeleafView.java:) [thymeleaf-spring5-3.0..RELEASE.jar:3.0..RELEASE]
at org.thymeleaf.spring5.view.ThymeleafView.render(ThymeleafView.java:) [thymeleaf-spring5-3.0..RELEASE.jar:3.0..RELEASE]
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:) [spring-webmvc-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:) [spring-webmvc-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:) [spring-webmvc-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:) [spring-webmvc-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:) [spring-webmvc-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:) [spring-webmvc-5.1..RELEASE.jar:5.1..RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:) [spring-webmvc-5.1..RELEASE.jar:5.1..RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:) [tomcat-embed-websocket-9.0..jar:9.0.]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:) [spring-web-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:) [spring-web-5.1..RELEASE.jar:5.1..RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:) [spring-web-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:) [spring-web-5.1..RELEASE.jar:5.1..RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:) [spring-web-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:) [spring-web-5.1..RELEASE.jar:5.1..RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:) [spring-web-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:) [spring-web-5.1..RELEASE.jar:5.1..RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:) [tomcat-embed-core-9.0..jar:9.0.]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:) [na:1.8.0_144]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:) [na:1.8.0_144]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:) [tomcat-embed-core-9.0..jar:9.0.]
at java.lang.Thread.run(Thread.java:) [na:1.8.0_144] -- ::28.378 ERROR --- [nio--exec-] 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: Error resolving template [<!DOCTYPE HTML>
<html>
 ": Error resolving template [<!DOCTYPE HTML>
<html>
<head>

报错原因:

是由于问题所在与解析问题,返回给

@RequestMapping(value = "/to_list" ,produces = "text/html")

    public String list(Model model, MiaoshaUser user, HttpServletRequest request, HttpServletResponse response) {
model.addAttribute("user", user);
//查询商品列表
List<GoodsVo> goodsList = goodsService.listGoodsVo();
model.addAttribute("goodsList", goodsList);
String html = redisService.get(GoodsKey.getGoodsList, "", String.class);
if (!StringUtils.isEmpty(html)){
return html;
} WebContext ctx = new WebContext(request,response,request.getServletContext(),
request.getLocale(),model.asMap());
html =thymeleafViewResolver.getTemplateEngine().process("goods_list",ctx);
return html;
}

返回浏览器是这个html,那么就需要以html形式返回,所以需要加上@responsebody来

Error resolving template,template might not exist or might not be accessible by any of the configured Template Resolvers的更多相关文章

  1. org.thymeleaf.exceptions.TemplateInputException: Error resolving template "/home/index2", template might not exist or might not be accessible by any of the configured Template Resolvers

    org.thymeleaf.exceptions.TemplateInputException: Error resolving template "/home/index2", ...

  2. template might not exist or might not be accessible by any of the configured Template Resolvers

    距离上一篇文章已经很长时间了,最近太忙碌了,今天发布spring boot遇到一个问题,找了好久才找到解决办法,今天贴出来和大家一起分享下,首先看错误信息 HTTP Status 500 - Requ ...

  3. 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)

    org.thymeleaf.exceptions.TemplateInputException: Error resolving template [code/leading], template m ...

  4. Spring Boot使用thymeleaf模板时报异常: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 Resolver ...

  5. template might not exist or might not be accessible by any of the configured Template Resolvers 完美解决

    初学者在maven spring boot web项目中使用thymeleaf 模板,经常会遇到  “template might not exist or might not be accessib ...

  6. SpringBoot使用thymeleaf模板时报错: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 ...

  7. Error resolving template “pages”, template might not exist or might not be accessible by any of the configured Template Resolver 或者 springboot使用thymeleaf时报html没有结束标签

    application.properties配置文件 spring.thymeleaf.prefix=classpath:/templates/ spring.thymeleaf.suffix=.ht ...

  8. org.thymeleaf.exceptions.TemplateInputException: Error resolving template "/ template might not exist or might not be accessible by any of the configured

    异常现象:在本地打包部署完全没有问题,资源文件也都可以映射上,但是打包成jar包部署到服务器上时,就一直报异常,异常信息如下: 严重: Servlet.service() for servlet [d ...

  9. 【SpringBoot+Mybatis+thymeleaf报错】Error resolving template "XXX", template might not exist or might not be accessible by any of the configured

    解决方法一: 原因:在使用springboot的过程中,如果使用thymeleaf作为模板文件,则要求HTML格式必须为严格的html5格式,必须有结束标签,否则会报错. 在application.y ...

随机推荐

  1. CSS:CSS 尺寸 (Dimension)

    ylbtech-CSS:CSS 尺寸 (Dimension) 1.返回顶部 1. CSS 尺寸 (Dimension) CSS 尺寸 (Dimension) 属性允许你控制元素的高度和宽度.同样,它允 ...

  2. Java方法中形参能否改变实参

    前几天学习了java中的参数传递机制,总结了一些知识点: 1·参数类型为基本数据类型:整型:byte,short,int,long ,浮点型:float,double ,字符型:char ,布尔型:b ...

  3. error C3867: “std::basic_string<char,std::char_traits<char>,std::allocator<char>>::c_str”: 函数调用缺少参数列表;请使用“&std::basic_string<char,std::char_traits<char>,std::allocator<char>>::c_str”创建指向成员的指针

    这个问题找了很多没有找到满意的答案.仔细看了一下,是使用了c_str的问题. 我直接把使用string.c_str的地方使用char*代替即解决问题.

  4. 并发新构件之Exchanger:交换器

    Exchanger:JDK描述:可以在对中对元素进行配对和交换的线程的同步点.每个线程将条目上的某个方法呈现给 exchange 方法,与伙伴线程进行匹配,并且在返回时接收其伙伴的对象.Exchang ...

  5. 1-Navicat无法远程连接Ubuntu上的MySQL(已解决)

    转发自: https://jingyan.baidu.com/article/4d58d54156ff069dd4e9c085.html

  6. rmq +二分暴力 hdu 5726

    参考博客 题意:n 个数字的数列,有m个询问:求出  L   到   R 的  gcd(最大公约数 ),然后问这整个序列中有多少个区间的  gcd  和这个一样. 分析:L 到  R的gcd直接用RM ...

  7. centos 时区设置初认识

    由于一些需要,我租用了一个海外服务器,并开始了我的centos之旅. 由于之前一直用虚拟机,而且在国内,所以不需要考虑时区的问题,但是现在,这个服务器是在海外的,所以就必须考虑时区的问题了.更何况我的 ...

  8. android webview 输入法键盘遮挡输入框的问题

    新建一个工具类: /** * 解决webView键盘遮挡问题的类 * Created by zqy on 2016/11/14. */ public class KeyBoardListener { ...

  9. VMware1设备与主机共享网络的问题

    问题的提出: 最近需要用到VMware1设备来配置网络,顺便将VMware1设备与主机进行共享网络,这样master就能直接访问网络了,但是原本以为直接在wlan设备上选择网络共享就行了,但是却没法收 ...

  10. tomcat 启用https协议

    利用tomcat服务器配置https双向认证. 1.为服务器生成证书 打开cmd,进入jdk的bin目录下,输入下面的命令: keytool -genkey -v -alias tomcat -key ...