将spring mvc 配置文件中
<beanclass="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"> <propertyname="messageConverters"> <list> <beanclass="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter"/> </list> </property> </bean>
改为
<beanclass="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"> <propertyname="messageConverters"> <list> <beanclass="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter"> <propertyname="supportedMediaTypes"> <list> <value>text/html;charset=UTF-8</value> </list> </property> </bean> </list> </property> </bean>