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,

  • 相关阅读:
    论单页Web应用和RESTful架构
    [译]作为一个web开发人员,哪些技术细节是在发布站点前你需要考虑到的
    JavaScript模块化规范
    一个Option请求引发的深度解析
    读《JavaScript语言精粹》的一些感言
    深圳积分入户经验之谈
    windows下的node-canvas历程
    linux服务器部署.net core 3.1
    Windows下Redis的安装、配置
    Linux Centos 安装宝塔面板一句命令解决
  • 原文地址:https://www.cnblogs.com/beenupper/p/7142074.html
Copyright © 2011-2022 走看看