Spring MVC JSON配置

来源:互联网 发布:python自动安装pip 编辑:程序博客网 时间:2024/06/10 21:51
<!-- Spring MVC JSON配置 -->
    <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
        <property name="messageConverters">
            <list>
                <!-- <bean id="fastJsonHttpMessageConverter" class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter"> -->
                <bean id="fastJsonHttpMessageConverter" class="sy.util.FastJsonHttpMessageConverter">
                    <property name="supportedMediaTypes">
                        <list>
                            <value>text/html;charset=UTF-8</value><!-- 避免IE出现下载JSON文件的情况 -->
                        </list>
                    </property>
                </bean>
            </list>
        </property>
    </bean>
0 0
原创粉丝点击