一分钟解决Springboot响应报错:would dispatch back to the current handler URL [/index] agai
报错简介
整合Springboot,在controller响应index.html页面的时候报错
报错代码log
There was an unexpected error (type=Internal Server Error, status=500).
Circular view path [/index]: would dispatch back to the current handler URL [/index] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
javax.servlet.ServletException: Circular view path [/index]: would dispatch back to the current handler URL [/index] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)at org.springframework.web.servlet.view.InternalResourceView.prepareForRendering(InternalResourceView.java:210)at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:148)at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:316)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)at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373)at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)at java.lang.Thread.run(Thread.java:748)
解决方案
springboot 默认不支持模板,添加上thymeleaf依赖后 就可以了。
1,添加模板引擎依赖
<!--thymeleaf 模板引擎 --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-thymeleaf</artifactId></dependency>
2,添加Springboot 中的前端配置
别忘了配置静态文件哦!
spring:mvc:static-path-pattern: /static/**thymeleaf:cache: false
解决成功效果图
一分钟解决Springboot响应报错:would dispatch back to the current handler URL [/index] agai相关推荐
- Springboot关于 Circular view path [xxx]: would dispatch back to the current handler URL [xxx] again
Springboot关于 Circular view path [xxx]: would dispatch back to the current handler URL [xxx] again报错问 ...
- spring cloud 报[Circular view path [refundbbb]: would dispatch back to the current handler URL [/refu
今天在调试spring cloud的过程中,在启动了一个eureka server ,一个eureka调用者,一个eureka提供者之后.请求在提供者的方法中处理后一直返回不到调用者,报错: [Cir ...
- Springboot错误--would dispatch back to the current handler URL [/XXX] again. Check your ViewResolv
控制台显示的错误: 2018-07-30 11:59:49.911 ERROR 17344 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherSer ...
- 解决 springboot 启动报错 -- Cannot determine embedded database driver class for database type NONE
前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家.点击跳转到教程. 1. 问题描述 我只是新建一个全新的 springboot 工程,什么都没有写的情况下启动报错如题: ...
- 生产环境中报错:would dispatch back to the current handler URL......
具体的报错信息: 在网上找的解决方法大体上有这么几种: 把@Controller改成@RestController 有可能是thymeleaf依赖导入异常,或者没导入thymeleaf依赖,可以尝试到 ...
- springBoot ajax 报错 Circular view path [xx: would dispatch...
2019独角兽企业重金招聘Python工程师标准>>> 报错如下 javax.servlet.ServletException: Circular view path [xx]: w ...
- 启动Spring项目报错,Springboot启动报错 Disconnected from the target VM 解决过程
启动Spring项目报错,Springboot启动报错 Disconnected from the target VM 解决过程 大概率是缺少了一下依赖 <dependency><g ...
- SpringBoot项目报错解决:“Error starting ApplicationContext. To display the conditions report re-run ...”
SpringBoot项目报错:Error starting ApplicationContext. To display the conditions report re-run your appli ...
- springboot项目报错:ERROR 9112 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] 的解决办法
启动springboot项目,访问页面后报错 报错信息如下: [nio-8087-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.ser ...
最新文章
- 计算机网络有限制,计算机网络中软件限制策略的应用规则有哪些
- 磁盘分区标为活动的方法及取消磁盘分区标为活动的方法
- SO做了Booked之后,一直处理于“已延交”,发运事务处理的活动区变灰
- DELL IDRAC9配置RAID
- golang key map 所有_Golang面试知识点总结
- Vue 单文件组件||Vue 单文件组件的基本用法||webpack 中配置 vue 组件的加载器|| 在 webpack 项目中使用 vue
- python之字符串的切片操作
- 班级派团队项目小计(十)
- Struts2.3.5+Hibernate3+Spring3.1基于注解实现的多文件上传,下载
- 深度学习弯道超车,领先行业不止一点点
- 美化UI合约区块链学习版系统+交易大厅
- senchaTouch 给组件传参的两种方式
- django orm 数据查询详解
- linux新建两个工作组,linux添加工作组
- 微信扫码支付、聚合支付
- Bebras挑战样题之五——警察能抓住海盗吗?
- js实现开平方 Math.sqrt
- 20175208 张家华 MyOD
- c语言写txt文件fwrite,文件操作 fwrite,该怎么处理
- HDU 1808 Halloween treats (鸽巢原理)(数学)