Hint: This may be the result of an unspecified view, due to default view name generation.)]

来源:互联网 发布:论持久战的影响知乎 编辑:程序博客网 时间:2024/05/18 13:09
严重: Servlet.service() for servlet [springmvc] in context with path [/blog] threw exception [Circular view path [showArticleType]: would dispatch back to the current handler URL [/blog/showArticleType] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)] with root cause

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


在开发时尽量不要自己注册如:

Java代码  收藏代码
  1. <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"/>  
  2. <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter">  

尽量使用

Java代码  收藏代码
  1. <mvc:annotation-driven/>   

它设计的已经足够好,使用子元素可以配置我们需要的配置。

  

且不要使用老版本的:

Java代码  收藏代码
  1. <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/>  
  2. <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">  

否则可能得到如下异常:

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

0 0
原创粉丝点击