springmvc解决ajax返回json数据乱码问题
2017-08-25 15:36
661 查看
<bean id="stringHttpMessageConverter" class="org.springframework.http.converter.StringHttpMessageConverter"> <property name="supportedMediaTypes"> <list> <value>text/plain;charset=UTF-8</value> <value>application/json;charset=UTF-8</value> </list> </property> </bean> <!-- 避免IE执行AJAX时,返回JSON出现下载文件 --> <!-- Jackson 是Spring 自带的功能 --> <bean id="mappingJackson2HttpMessageConverter" class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"> <property name="supportedMediaTypes"> <list> <value>application/json;charset=UTF-8</value> <value>application/xml;charset=UTF-8</value> <value>text/html;charset=UTF-8</value> <value>text/plain;charset=UTF-8</value> <value>text/xml;charset=UTF-8</value> <value>text/javascript;charset=UTF-8</value> </list> </property> </bean> <mvc:annotation-driven> <mvc:message-converters> <ref bean="stringHttpMessageConverter" /> <ref bean="mappingJackson2HttpMessageConverter" /> </mvc:message-converters> </mvc:annotation-driven>
相关文章推荐
- dhl:ajax无法跨域改用getJSON(解决服务器返回json数据中文为乱码的问题$.ajaxSetup({ scriptCharset: "utf-8" , contentType: "application/json; chars)
- 解决Ajax返回的json数据乱码问题
- 下载文件名字乱码问题,json_encode解决Ajax 返回字符串数据不显示问题
- 解决springmvc返回json数据IE出现文件下载和json数据中文乱码问题
- SpringMVC学习—使用ajax返回Json出现乱码解决方法
- jQuery UI Autocomplete 使用 ajax 方法传输Json数据出现乱码问题的解决
- springMVC返回json数据乱码问题及@RequestMapping 详解
- Spring MVC后台返回JSON数据中文乱码问题解决
- springMVC_json格式数据的接收和发送(未解决中文乱码问题)
- 解决服务器返回JSON数据中文乱码问题
- springMvc框架解决返回Json格式中文乱码问题
- springMVC返回json数据乱码问题及@RequestMapping 详解
- 使用ajax请求SpringMVC返回Json出现乱码解决方法
- Spring MVC3返回JSON数据中文乱码问题解决
- SpringMVC Ajax返回的请求json 的方式来解决在中国字符串乱码问题
- SpringMVC3的ResponseBody返回字符串(JSON)乱码问题解决
- 解决SpringMVC返回Json数据格式不严谨报异常的问题(草稿未完成)
- JavaScript传中文值给Action出现乱码问题解决和返回ajax 返回 输出 json 乱码
- SpringMVC返回json数据+解决中文乱码