Circular view path [***]: would dispatch back to the current handler URL [/sprin

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 21:00   2406   0

背景:IDEA中新建springmvc程序,运行tomcat报错

Circular view path [hello]: would dispatch back to the current handler URL [/springmvc_01/hello] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)

运行tomcat。浏览器报错。详细错误信息如下

HTTP Status 500 – Internal Server Error

Type Exception Report
Message Circular view path [hello]: would dispatch back to the current handler URL [/springmvc_01/hello] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception 
javax.servlet.ServletException: Circular view path [hello]: would dispatch back to the current handler URL [/springmvc_01/hello] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
 org.springframework.web.servlet.view.InternalResourceView.prepareForRendering(InternalResourceView.java:205)
 org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:145)
 org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303)
 org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1286)
 org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1041)
 org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:984)
 org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
 org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
 org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
 org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
 org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

Note The full stack trace of the root cause is available in the server logs.

Apache Tomcat/7.0.93

解决方法:

是control类导包错误(这个包因为ModelAndView

发现是import org.springframework.web.portlet.ModelAndView;有问题,本应该是import org.springframework.web.servlet.ModelAndView;

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP