The annotation @ResponseBody is disallowed for this location

The annotation @ResponseBody is disallowed for this location


/**

* 保存或更新情景

**/

@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


你可能感兴趣的:(java,spring,spring,mvc,responsebody,RequestBody)