json 返回报 406 错误 解决方法

springMVC 中 用fastjson 返回json 数据时 报 406 错误

<mvc:annotation-driven>
        <mvc:message-converters register-defaults="false">
            <bean id="fastJsonHttpMessageConverter" class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
                <property name="supportedMediaTypes">
                    <list>
                        <value>application/json;charset=UTF-8</value>
                    </list>
                </property>
            </bean>
        </mvc:message-converters>
    </mvc:annotation-driven>

json 返回报 406 错误 解决方法_第1张图片

解决方法:

添加 jackson-databind.jar 解决;

maven 地址:

<dependency>
	<groupId>com.fasterxml.jackson.core</groupId>
	<artifactId>jackson-databind</artifactId>
	<version>2.7.3</version>
</dependency>




你可能感兴趣的:(fastjson,解决,错误,406)