fastjson icon indicating copy to clipboard operation
fastjson copied to clipboard

Fastjson1.1.41与springMVC 4.1.6结合失效

Open yl23250 opened this issue 11 years ago • 2 comments

之前使用springmvc3.2.10都时候,在spring.xml中配置是有效的, 配置如下,

<mvc:annotation-driven >
        <mvc:message-converters  register-defaults="true">
            <bean class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
                <property name="supportedMediaTypes" value="text/html;charset=UTF-8" />
                <property name="features">
                    <array>
                        <value>WriteMapNullValue</value>
                        <value>WriteNullStringAsEmpty</value>
                        <value>WriteDateUseDateFormat</value>
                    </array>
                </property>
            </bean>
        </mvc:message-converters>
    </mvc:annotation-driven>

但是 升级到4.1.6版本都springmvc后 上述配置失效 麻烦大家有经验都告诉下,问题所在 暂时先用官方文档上都jackson message converter了。 一直喜欢alibaba的东西,改了别扭

yl23250 avatar Nov 27 '15 16:11 yl23250

奇怪了

加了一个这个            <bean class="org.springframework.http.converter.StringHttpMessageConverter">

编译下又好了。可能是idea变异失败吧。以后再看看。遇到有类似情况也指教下,谢谢

yl23250 avatar Nov 27 '15 16:11 yl23250

那我先关闭了啊

wenshao avatar Apr 12 '16 04:04 wenshao