<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans.xsd">

    <description>spring Json处理</description>

    <!-- 基于注解的定制的WebBindingInitializer，方法级别的处理器映射 要把 mvc:annotation-driven 放在后面 -->

    <!--fastJson -->
    <bean id="jsonConverter" class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
        <property name="supportedMediaTypes">
            <list>
                <value>text/plain;charset=utf-8</value>
                <value>text/html;charset=utf-8</value>
                <value>text/json;charset=utf-8</value>
                <value>application/json;charset=utf-8</value>
                <value>text/html;charset=utf-8</value>
            </list>
        </property>
        <!--能自己配置一些东西，比如时间的格式化，null输出""等等 -->
        <property name="fastJsonConfig" ref="fastJsonBean"/>
    </bean>

    <bean id="fastJsonBean" class="com.alibaba.fastjson.support.config.FastJsonConfig">
        <property name="serializerFeatures">
            <list>
                <value>WriteMapNullValue</value>
                <value>QuoteFieldNames</value>
                <value>BrowserSecure</value>
            </list>
        </property>
        <property name="dateFormat" value="yyyy-MM-dd HH:mm:ss"/>
    </bean>

    <!-- 转json MappingJackson2HttpMessageConverter -->
    <!-- <bean id="jaxbJacksonObjectMapper" class="com.zw.um.core.commons.JaxbJacksonObjectMapper" /> -->
    <!-- 避免IE执行AJAX时,返回JSON出现下载文件 -->
    <!-- <bean id="jsonConverter" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">  -->
    <!--    <property name="supportedMediaTypes" value="application/json" />  -->
    <!--    <property name="objectMapper" ref="jaxbJacksonObjectMapper" />  -->
    <!-- </bean> -->
</beans>