http://www.cnblogs.com/byshome/archive/2013/03/21/2973405.html
org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation 错误处理
需要在方法上加上红色的字
@RequestMapping(value="/uploadimg.htm", produces="application/json")
public @ResponseBody JsonResponse uploadImage(@RequestParam int category, @RequestParam long owner, @RequestParam MultipartFile file){
自己补充一点,也是自己犯的错误
我曾经把application/json写成text/json 这样前台接收成了html类型。。。。。
本文介绍了解决Spring框架中出现的“Could not find acceptable representation”错误的方法,该问题通常发生在请求的内容类型与服务器提供的内容类型不匹配时。文章通过具体示例展示了如何在控制器方法上使用@RequestMapping注解来指定返回的内容类型。
6145

被折叠的 条评论
为什么被折叠?



