<mvc:annotation-driven>
<mvc:message-converters>
     <!-- 将StringHttpMessageConverter的默认编码设为UTF-8 -->
<bean class="org.springframework.http.converter.StringHttpMessageConverter">
<constructor-arg value="UTF-8" />
</bean>
</mvc:message-converters>
</mvc:annotation-driven>

配置默认转换器的编码格式为UTF-8,源码里是ISO-8859-1

-------------------------------

<mvc:annotation-driven>标签开启了13个bean

包含了替换3.1之前的废弃bean

DefaultAnnotationHandlerMapping -> RequestMappingHandlerMapping

AnnotationMethodHandlerAdapter -> RequestMappingHandlerAdapter

AnnotationMethodHandlerExceptionResolver -> ExceptionHandlerExceptionResolver

---------------------------------------13个bean

mvcContentNegotiationManager,
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping,-----------启用了最新的RequestMappingHandlerMapping
mvcCorsConfigurations,
org.springframework.format.support.FormattingConversionServiceFactoryBean#0,
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter,---------启用了最新的RequestMappingHandlerAdapter
mvcUriComponentsContributor,
org.springframework.web.servlet.handler.MappedInterceptor#0,
org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0,----------启用了最新的ExceptionHandlerExceptionResolver
org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver#0,
org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver#0,
org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping,
org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,

spring mvc json乱码的更多相关文章

  1. Spring MVC JSON乱码问题

    之前项目中也遇到过返回JSON时乱码问题,当时找到了一个方法解决了问题但是没有明白原因,今天这个项目又遇到了JSON乱码问题,用之前的方法不行,看了这篇博文才明白为什么 @RequestMapping ...

  2. spring mvc json 返回乱码问题解决(vestion:3.x.x)

    本文是转载文章,感觉比较好,如有侵权,请联系本人,我将及时删除. 原文网址:<spring mvc json 返回乱码问题解决(vestion:3.x.x)> 工程中用springmvc返 ...

  3. spring mvc: json练习

    spring mvc: json练习 本例需要用到的json包: 如下: jackson-databind jackson-core jackson-annotations <!-- https ...

  4. Spring MVC JSON自己定义类型转换(续)

    前面提到了两种转换类型的方法(Spring MVC JSON自己定义类型转换),这里针对Json转换提供一种更简便的方法. 通过配置全局的日期转换来避免使用麻烦的注解. 首先用到了一个简单的日期工具类 ...

  5. spring mvc json返回防止乱码

    乱码问题 乱码一直是编程的常见问题,spring mvc 返回json数据时可能导致乱码,需要在controller中添加如下代码: @RequestMapping("/test" ...

  6. spring mvc 返回乱码SpringMVC使用@ResponseBody注解返回中文字符串乱码的问题

    原文地址:https://www.cnblogs.com/fzj16888/p/5923232.html 先说一下我的经历,以及解决问题的而过程. 在使用SpringMVC的时候,最开始的时候在配置文 ...

  7. [Spring MVC] - JSON

    Spring MVC中使用JSON,先必需引用两个包:jackson-core-asl-1.9.13.jar.jackson-mapper-asl-1.9.13.jar 因为需要使用到jquery测试 ...

  8. spring mvc 中文乱码 post与get的方法解决

    spring mvc表单提交中文参数乱码问题 今天测试spring mvc  ,中文乱码,在web.xml中加上 <filter> <filter-name>encodingF ...

  9. Spring MVC JSON 实现JsonSerializer Date类型转换

    转载至:http://blog.csdn.net/lantianzhange/article/details/40920933 在Spring MVC中存在两大类的类型转换,一类是Json,一个是Sp ...

随机推荐

  1. python 2.7和3.7都支持的情况 bit_length() pycharm 更改解释器

    1.头部加: #!/usr/bin/env python # -*- coding:utf-8 -*-    2.bit_length() :当前数值为二进制时,至少要用多少为表示 a = 5 b = ...

  2. VS2010与Matlab2010b混合编程

    环境: 1.VS2010 2.MATLAB 2010b 3.WINDOW 7 (X64) 1.Matlab环境设置 要建立独立运行的C应用程序,系统中需要安装Matlab.Matlab编译器.C/C+ ...

  3. i3wm 调节音量

    i3wm,设置调节音量的快捷键 configure file: ~/.config/i3/config add # for sound control bindsym XF86AudioRaiseVo ...

  4. Java中对List集合的常用操作

    目录: list中添加,获取,删除元素: list中是否包含某个元素: list中根据索引将元素数值改变(替换): list中查看(判断)元素的索引: 根据元素索引位置进行的判断: 利用list中索引 ...

  5. s21day20 python笔记

    s21day20 python笔记 一.内容回顾 面向对象的三大特性 封装 函数封装到类 数据封装到对象 继承 多态 二.成员 2.1 类成员 类变量(静态字段) 定义:写在类的下一级,和方法同一级 ...

  6. Hadoop_CDH安装

    ——本文非个人原创,为大牛同事整理,发布于此以备忘 1     CDH5.8安装(2018年4月19日) 1.1   物理服务器注意事项 (1)把raid都去掉了,每个物理盘都用raid0创建一个虚拟 ...

  7. Blob与Clob转字符串

    /** * blob转字符串 * * @param blob * @return * @throws IOException * @throws SQLException */ public stat ...

  8. final、finally、以及finalize的区别

    final ---修饰类.变量和方法,修饰的类不能被继承 .修饰的方法不能被重写 .修饰的成员变量不可更改 另外,修饰成员变量必须立即赋值,修饰局部变量使用之前被赋值就可以. finally通常和tr ...

  9. Privoxy代理的使用

    目录 1. Privoxy介绍 1.1 安装 1.2 配置 1.3 使用 1.4 其他配置 1.5 测试链接及查看配置 2. 相关信息 https://www.privoxy.org/ http:// ...

  10. Mybatis根据List批量查询List结果

    https://blog.csdn.net/qq_36688928/article/details/82783392