zoukankan      html  css  js  c++  java
  • 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>
    历经苦难而不厌,此乃阿修罗之道。
  • 相关阅读:
    HDU 1003 Max Sum
    HDU 1728 逃离迷宫
    UVA 10057 A midsummer night's dream.
    HDU 1232 畅通工程
    poj3331
    poj3481
    poj1053
    poj3281
    poj3199
    !!! Gridview的多种使用方法总结
  • 原文地址:https://www.cnblogs.com/echo1314/p/10192547.html
Copyright © 2011-2022 走看看