admin管理员组文章数量:1612097
描述 & 错误
响应码500
Type: Exception Report
Message: Circular view path [updateUserinfo]: would dispatch back to the current handler URL [/shop/updateUserinfo] 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.
原因 & 解决
一般是映射处理这个url请求的控制器 方法返回值问题
- 比如没有跳转页面,没有返回对象(即void)则报错
- 控制器处理方法跳转到映射的请求反复也会如此
@RequestMapping(value = "/updateUserinfo", method = RequestMethod.POST)
public void updateUserinfo(Userinfo userinfo) throws IOException {
....
return;
}
这个返回值类型为void, 方法体也没有跳转页面的话,则会包这个错误。
如果把返回值类型改为String(并不配置视图解析器映射), 对应的是返回404而已
解决方法比较简单,就是规避原因即可。比如修改返回类型,也可以返回JSON,页面跳转等等
版权声明:本文标题:Spring MVC报错500: Circular view path [xxx]: would dispatch back to the current handler URL 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dongtai/1728629804a1166952.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论