您的位置:首页 > Web前端 > JQuery

springMVC IE9浏览器 jQuery的json数据拦截提示下载或者保存解决方法

2014-12-08 16:54 549 查看
在做电商项目是遇到一个问题:

json 提交数据时,IE提示需要保存或者下载......

解决方法:

springMVC.xml配置:

<mvc:annotation-driven>

<mvc:message-converters register-defaults="true">

<!-- 将StringHttpMessageConverter的默认编码设为UTF-8 -->

<bean class="org.springframework.http.converter.StringHttpMessageConverter">

<constructor-arg value="UTF-8" />

</bean>

<!-- 将Jackson2HttpMessageConverter的默认格式化输出设为true -->

<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">

<property name="prettyPrint" value="true"/>

//加入一下配置

<property name="supportedMediaTypes">

<list>

<value>text/html;charset=UTF-8</value>

</list>

</property>

</bean>

</mvc:message-converters>

</mvc:annotation-driven>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐