@RestController VS @Controller,请求返回的究竟是网页还是其他,例如json串
使用springmvc返回string或者json的话就直接用@RestController。如果想要页面跳转的话,就使用@Controller。
@RestController注解相当于@ResponseBody + @Controller合在一起的作用。
1)如果只是使用@RestController注解Controller,则Controller中的方法无法返回jsp页面,配置的
转载
2016-12-07 10:41:50 ·
5479 阅读 ·
0 评论