SpringMVC返回Json失败,请检查是否配置了Jackson
来源:互联网 发布:学网络编程 编辑:程序博客网 时间:2024/05/16 11:29
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
<
dependency
>
<
groupId
>com.fasterxml.jackson.core</
groupId
>
<
artifactId
>jackson-core</
artifactId
>
<
version
>2.6.0</
version
>
</
dependency
>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
<
dependency
>
<
groupId
>com.fasterxml.jackson.core</
groupId
>
<
artifactId
>jackson-annotations</
artifactId
>
<
version
>2.6.0</
version
>
</
dependency
>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
<
dependency
>
<
groupId
>com.fasterxml.jackson.core</
groupId
>
<
artifactId
>jackson-databind</
artifactId
>
<
version
>2.6.0</
version
>
</
dependency
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!--Begin:使用Jackson 2.x的配置,需要导入的jar包:jackson-core-xxx.jar、jackson-annotations-xxx.jar、jackson-databind-xxx.jar-->
<!--通过处理器映射DefaultAnnotationHandlerMapping来开启支持@Controller注解-->
<
bean
class
=
"org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"
/>
<!--通过处理器适配器AnnotationMethodHandlerAdapter来开启支持@RequestMapping注解-->
<
bean
class
=
"org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"
>
<
property
name
=
"messageConverters"
>
<
list
>
<!-- 设置返回字符串编码 -->
<
bean
class
=
"org.springframework.http.converter.StringHttpMessageConverter"
>
<
property
name = "supportedMediaTypes">
<
list
>
<
value
>text/html;charset=UTF-8</
value
>
<
value
>application/json;charset=UTF-8</
value
>
</
list
>
</
property
>
</
bean
>
<!-- json转换器 -->
<
bean
class
=
"org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"
>
<
property
name
=
"supportedMediaTypes"
>
<
list
>
<
value
>text/html;charset=UTF-8</
value
>
<
value
>application/json;charset=UTF-8</
value
>
</
list
>
</
property
>
</
bean
>
</
list
>
</
property
>
</
bean
>
<!--End:使用Jackson 2.x的配置,需要导入的jar包:jackson-core-xxx.jar、jackson-annotations-xxx.jar、jackson-databind-xxx.jar-->
阅读全文
0 0
- SpringMVC返回Json失败,请检查是否配置了Jackson
- 使用springmvc+jackson+hibernate返回JSON数据
- springmvc 返回json配置
- 配置springmvc返回json
- springMvc配置json返回
- 服务端配置资源解析失败,请检查
- 服务端配置资源解析失败,请检查 .
- springmvc返回json中文乱码及使用jackson自动转换
- 动软出现“添加服务器配置失败,请检查是否有写入权限或文件是否存在“错误
- springmvc 的 json返回配置
- SpringMVC配置返回JSON数据格式
- SpringMVC json处理 (Jackson)
- hosts文件无法修改怎么办 保存文档失败,请检查文件是否被另一个应用程序打开了
- 动软代码生成器 添加数据库服务器时失败,提示信息:添加服务器配置失败,请检查是否有写入权限或文件是否存在
- 8021x 获取IP信息失败,请检查锐捷认证客户端当前配置是否符合所在网络的要求,检查完毕后尝试重新认证
- SpringMvc配置使用jackson
- SpringMVC+Jackson的配置
- SpringMVC 配置Jackson方法
- 2017.8.08 SSL 模拟赛
- python中的私有化
- A
- JAVA类集(2)简单操作
- leetcode--Sqrt(x)
- SpringMVC返回Json失败,请检查是否配置了Jackson
- 【php中的curl】php中curl的详细解说
- MUI Android分享功能
- windows 查看端口占用
- 正则化方法:L1和L2 regularization、数据集扩增、dropout
- 整数中1出现的次数
- 打通微信通信第一步
- 数串
- 【SpringCloud】(二):服务发现和服务注册