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}The annotation @ResponseBody is disallowed for this locationp.

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


目录
相关文章
|
4月前
|
XML 前端开发 Java
SpringMVC中context:annotation-config与mvc:annotation-driven和context:component-scan区别详解
SpringMVC中context:annotation-config与mvc:annotation-driven和context:component-scan区别详解
35 0
|
8月前
SpringMVC@RequestMapping相关属性
SpringMVC@RequestMapping相关属性
23 0
|
JSON 前端开发 Java
SpringMVC中@RequestBody和@ResponseBody两个注解的区别
📒 程序员小王的博客:程序员小王的博客 🎉 欢迎点赞 👍 收藏 ⭐留言 📝 😊 如有编辑错误联系作者,如果有比较好的文章欢迎分享给我,我会取其精华去其糟粕 🍅java自学的学习路线:java自学的学习路线 今天我想详细的了解一下Spring MVC中@RequestBody和@ResponseBody的区别,让我自己在开发中更好的使用这两个注解
160 0
SpringMVC中@RequestBody和@ResponseBody两个注解的区别
|
12月前
|
Java 测试技术 Spring
Configuration problem: Failed to import bean definitions from URL location classpath:spring-mvc.xml
Configuration problem: Failed to import bean definitions from URL location classpath:spring-mvc.xml
607 0
|
JSON Dubbo Java
Failed to meta-introspect annotation interface org.springframework.web.bind.annotation.RequestBody:
Failed to meta-introspect annotation interface org.springframework.web.bind.annotation.RequestBody:
221 0
Failed to meta-introspect annotation interface org.springframework.web.bind.annotation.RequestBody:
|
Java Spring
springmvc:405 request method post not supported
springmvc:405 request method post not supported
131 0
|
Java
SpringBoot - Ambiguous mapping Cannot map “XXXController” method
SpringBoot - Ambiguous mapping Cannot map “XXXController” method
103 0
SpringMVC - @RequestMapping、@ResponseBody、@RequestBody、@RequestParam、@PathVariable(一)
SpringMVC - @RequestMapping、@ResponseBody、@RequestBody、@RequestParam、@PathVariable(一)
84 0
SpringMVC - @RequestMapping、@ResponseBody、@RequestBody、@RequestParam、@PathVariable(一)
|
XML Java 数据格式
Spring的applicationContext.xml的配置和lookup-method,replaced-method的使用(三)
Spring的applicationContext.xml的配置和lookup-method,replaced-method的使用(三)
139 0
Spring的applicationContext.xml的配置和lookup-method,replaced-method的使用(三)
Request mapping url and handler registration
Request mapping url and handler registration
103 0
Request mapping url and handler registration