再做接口开发时,遇到一个问题 Could not resolve view with name 'xxx' in servlet with name 'dispatcherServlet'
warning:
这篇文章距离上次修改已过606天,其中的内容可能已经有所变动。
用的springboot框架
在控制器上加了 两个注解
@Controller
@RequestMapping("/kingowSSO")

我写了一个方法,
刚开始我的方法没有这个注解,当请求过来时方法可以正常执行,但是方法执行完毕后,程序会报错,挺奇怪的,我的方法没有返回值用的 void ,理论上是不需要加 @ResponseBody 注解的才对啊
@ResponseBody

但是不加 @ResponseBody 注解 程序会报错

Could not resolve view with name 'xxx' in servlet with name 'dispatcherServlet'