zoukankan      html  css  js  c++  java
  • spring 3.2 配置jackson

    <mvc:annotation-driven>
            <mvc:message-converters>
                <ref bean="stringHttpMessageConverter"/>
                <ref bean="mappingJackson2HttpMessageConverter"/>
            </mvc:message-converters>
        </mvc:annotation-driven>
    
        <bean id="stringHttpMessageConverter"
              class="org.springframework.http.converter.StringHttpMessageConverter"/>
        <bean id="mappingJackson2HttpMessageConverter"
              class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
            <property name="supportedMediaTypes">
                <list>
                        <value>text/html;charset=UTF-8</value>
                        <value>application/json;charset=UTF-8</value>
             <value>application/x-www-form-urlencoded;charset=UTF-8</value>
                </list>
            </property>
        </bean>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>2.7.4</version>
    </dependency>
    
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.7.4</version>
    </dependency>
    
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>2.7.4</version>
    </dependency>

    参见:

    https://www.cnblogs.com/sonng/p/6652059.html

    但我发现fastjson的评价并不好

  • 相关阅读:
    Connected Graph
    Gerald and Giant Chess
    [NOI2009]诗人小G
    四边形不等式小结
    [NOI2007]货币兑换
    Cats Transport
    Cut the Sequence
    Fence
    The Battle of Chibi
    [Usaco2005 Dec]Cleaning Shifts
  • 原文地址:https://www.cnblogs.com/MaxLife/p/8797844.html
Copyright © 2011-2022 走看看