<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绑定

    目前很多学习资料这样解释赋值与绑定,当是一个简单变量时,是赋值,当是复合变量时,是绑定. 注:赋值是重新复制变量到新变量中,赋值前后两个变量之间无联系.例C语言中: int a=6: int b: b ...

  2. 把一个给定的值存储到一个整数中指定的几个位《C与指针5.8.5》

    编写一个函数,把一个给定的值存储到一个整数中指定的几个位.它的原型如下: int store_bit_field(int original_value, int value_to_store, uns ...

  3. JavaSE-2018.12.20更新

    JDK:Java Development Kit(java开发工具包,是提供给java开发人员使用的,包含了开发工具(编译工具javac.exe和打包工具jar.exe等)+JRE) JRE:Java ...

  4. TrustManagerService.java

    /* * Copyright (C) 2014 The Android Open Source Project * * Licensed under the Apache License, Versi ...

  5. 2.4 逻辑运算符 &&(与)、||(或)、非(!)

    一.逻辑运算符 &&(与).||(或).非(!) 逻辑运算符两边的表达式一定是布尔值,结果也是布尔值. 1.1.1 逻辑与 && => 表示并且.且的意思: tr ...

  6. Unity 常用插件1

    作者:Meta42链接:https://www.zhihu.com/question/29097415/answer/229015898来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转 ...

  7. [Python学习笔记] turtle库的基本使用

    turtle库常用函数 引入turtle模块 import turtle turtle的绘图窗体 #setup()设置窗口大小及位置#setup()可省略turtle.setup(width,heig ...

  8. 下载jar包的网站

    http://mvnrepository.com/ http://findjar.com http://sourceforge.net/

  9. visual studio 2017 创建 android 本地共享库(.so) 并从 C# android 项目中调用

    Developing Xamarin Android Native Applications ★★★★★ ★★★★ ★★★ ★★ ★ February 23, 2015 by Ankit Asthan ...

  10. 常用oracle中系统表查询语句

    sqlplus / as sysdbaSQL>select status from v$instance;1.查看最大连接数show parameter processes;2.查询oracle ...