参考文章:https://www.cnblogs.com/gxz-sw/p/6860447.html?ivk_sa=1024320u
1.先得有这个alibaba的jar包
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.66</version>
</dependency>
2.springmvc配置
<mvc:annotation-driven>
<mvc:message-converters register-defaults="true">
<!-- 避免IE执行AJAX时,返回JSON出现下载文件 -->
<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>
3.正常使用
@ResponseBody
@RequestMapping("/addFaceData")
public Result addFaceData(Customer a, String baseimg){
备注: