zoukankan      html  css  js  c++  java
  • spring mvc json乱码

        <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,

  • 相关阅读:
    js中不同的height, top的对比
    正则表达式入门以及记录
    CSS小记(持续更新......)
    Git远程操作
    Git Push 避免用户名和密码方法
    Git本地操作
    CSS3动画属性
    c语言文法
    实验一、词法分析器实验
    词法分析器
  • 原文地址:https://www.cnblogs.com/beenupper/p/7142074.html
Copyright © 2011-2022 走看看