• json转换器映射文件配置


    //MappingJacksonHttpMessageConverter转换器,将对象转为json响应给浏览器 :

     1 <mvc:annotation-driven>
     2         <mvc:message-converters>
     3             <bean class="org.springframework.http.converter.StringHttpMessageConverter">
     4                 <!-- <constructor-arg ref="utf8Charset"/> -->
     5                  <!-- <property name="supportedMediaTypes" value = "text/plain;charset=UTF-8" /> -->
     6                  <property name="writeAcceptCharset" value="false" /><!-- 用于避免响应头过大 --> 
     7                  <property name = "supportedMediaTypes">
     8                     <list>
     9                         <value>text/plain;charset=UTF-8</value>   
    10                         <value>text/html;charset=UTF-8</value>   
    11 <!--                         <value>text/json;charset=UTF-8</value>    -->
    12                     </list>   
    13                  </property>
    14             </bean>
    15             <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
    16                  <property name = "supportedMediaTypes">
    17                     <list>
    18                         <value>text/json;charset=UTF-8</value>   
    19                     </list>   
    20                  </property>
    21                 
    22             </bean>
    23         </mvc:message-converters>
    24     </mvc:annotation-driven>
    历经苦难而不厌,此乃阿修罗之道。
  • 相关阅读:
    mybatis-spring 集成
    maven 插件深入了解
    maven 常用插件3
    maven 插件2
    <转载> maven 详解 http://www.cnblogs.com/binyue/p/4729134.html
    linux base shell 基础语法
    浏览器运行原理
    <转载> js 闭包
    dubbo 学习资料
    HTTP
  • 原文地址:https://www.cnblogs.com/echo1314/p/10192547.html
Copyright © 2020-2023  润新知