SPringMVC在使用JSON的数据传输时Error: Content type 'application/json;charset=UTF-8' not supported
来源:互联网 发布:中国迁都论 知乎 编辑:程序博客网 时间:2024/05/23 19:14
SPringMVC在使用JSON的数据传输时Error:org.springframework.web.HttpMediaTypeNotSupportedException: Content type
在学习SpringMVC的时候有一个功能是可以在客服端传递JSON数据到服务端,服务端会解析传过来的JSON数据使之变成对应的java对象,同样的服务端也可以把java对象转为JSON数据传递到客服端,但是在使用这个功能的时候已经导入了相应的包但是还是出现Error:org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json;charset=UTF-8' not supported。
实验了很多方法也不行之后发现可能是包的版本的错误,我之前使用的是Springmvc4.2包JSON使用jackson 1.9.0的包;之后把JSON的包换成jackson 2.6之后就解析成功,JSON从服务端传递到服务端解析成为java对象,在返回java对象转化的JSON数据传递到客服端。
这里附加 jackson 2.6版本的jar下载:http://download.csdn.net/detail/u014104286/9574394
否
1 0
- SPringMVC在使用JSON的数据传输时Error: Content type 'application/json;charset=UTF-8' not supported
- SpringMVC在使用JSON时出现Error: Content type 'application/json;charset=UTF-8' not supported
- HttpMediaTypeNotSupportedException: Content type 'application/json;charset=UTF-8' not supported
- Handler execution resulted in exception: Content type 'application/json;charset=UTF-8' not supported
- Retrofiy学习"Content-Type: application/json;charset=UTF-8"@Body的使用
- Content type expected:<application/json;charset=UTF-8> but was:<application/hal+json;charset=UTF-8>
- Okhttp3问题 Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported
- Content type 'text/plain;charset=UTF-8' not supported
- AjaxAnywhere content-type in not text/xml : [text/json;charset=UTF-8]
- HttpMediaTypeNotSupportedException: Content type 'application/json;' not supported 问题原因之一
- 获取 request 中用POST方式"Content-type"是"application/x-www-form-urlencoded;charset=utf-8"发送的 json 数据
- 获取 request 中用POST方式"Content-type"是"application/x-www-form-urlencoded;charset=utf-8"发送的 json 数据
- (转)获取 request 中用POST方式"Content-type"是"application/x-www-form-urlencoded;charset=utf-8"发送的 json 数据
- springmvc 设置content-type为 application/json
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">的作用
- header("Content-Type:text/html;charset=utf-8");
- header('Content-Type: text/html; charset=utf-8');
- header('Content-Type: text/html; charset=utf-8');
- HTML5之article元素与section元素之间的区别?
- Java学习笔记(十七):并发
- 通过shell脚本进行数据库操作
- 例题8-12 UVA - 12627 Erratic Expansion 奇怪的气球膨胀 (递归)
- js打印杨辉三角的另一种方法
- SPringMVC在使用JSON的数据传输时Error: Content type 'application/json;charset=UTF-8' not supported
- 【Twitter Storm系列】flume-ng+Kafka+Storm+HDFS 实时系统搭建
- 用Reader模拟BufferedReader的readLine()功能
- Redis学习笔记02--Redis的安装
- NoSuchMethodError: java.lang.System.lineSeparator()
- linux命令 more
- Java关键字
- cookie和session机制
- AES对称加密