spring boot 访问controller报错:视图解析异常

控制台:would dispatch back to the current handler URL [/findAllNews] again. Check your ViewResolver setup!

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

错误原因:@Controller中的视图解析器不能解析json格式内容,导致视图解析出错

解决方法:将@Controller 改成@RestController

上一篇:redux


下一篇:CBV源码分析