The annotation @ResponseBody is disallowed for this location

来源:互联网 发布:学术数据库有哪些 编辑:程序博客网 时间:2024/05/16 03:42
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545}

The annotation @ResponseBody is disallowed for this location


p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545}p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px '.PingFang SC'; color: #454545}p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545; min-height: 14.0px}span.s1 {font: 12.0px 'Helvetica Neue'}span.s2 {font: 12.0px '.PingFang SC'}span.s3 {text-decoration: underline}span.s4 {font: 12.0px '.PingFang SC'; text-decoration: underline}span.Apple-tab-span {white-space:pre}

/**

* 保存或更新情景

**/

@RequestMapping("/save.do")

@ResponseBody

public void save(@ResponseBody Scene scene, HttpServletRequest request, HttpServletResponse response) throws Exception {

Personal personal = SecurityUtils.getPersonal(request);

Long personalId = personal.getId();

if (personalId == null) {

outFailureJson(response, BaseCodeMessage.personal_10001);

return;

}




错误原因是把 @ResponseBody 写错位置了。


本来是想写 @RequestBody 的,结果写成了 @ResponseBody


7 0
原创粉丝点击