参考文档,点击进入
1 <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"> ?2 ????<property name="messageConverters"> ??3 ?????????<list> ??4 ?????????????<bean class="org.springframework.http.converter.StringHttpMessageConverter"> ??5 ?????????????????<property name="supportedMediaTypes"> ??6 ????????????????????<list> ??7 ????????????????????????<value>text/html;charset=UTF-8</value> ??8 ?????????????????????</list> ??9 ??????????????????</property> ?10 ??????????????</bean> ?11 ????????????</list> ?12 ????</property> ?13 </bean>
操作步骤:
把上面的代码,拷贝到你的Spring框架对应的配置文件xml中,上述代码要在
<!-- 支持SpringMVC中的注解 --><mvc:annotation-driven />
之前出现。试试吧,不行的话,继续搜索,行的话,请收藏这段代码
Json的@ResponseBody注解传输中文的乱码问题
原文地址:https://www.cnblogs.com/todaylockhere/p/9456888.html