在做ajax请求时,会发生如图中的错误 org.springframework.web.HttpMediaTypeNotSupportedException: Content type ‘application/x-www-form-urlencoded;charset=UTF-8’ not supported 解决方法如下: ajax请求加上这句话: contentType: "application/json" 问题就可以搞定,json化自己对象后,必须声明数据传输类型为json格式