您的位置:首页 > 编程语言 > Java开发

Spring MVC @ResponseBody 中文乱码 解决方案

2015-07-02 18:12 555 查看

Spring MVC @ResponseBody 中文乱码 解决方案1

在springmvc-servlet.xml中加入以下代码

<mvc:annotation-driven>
<mvc:message-converters>
<bean class="org.springframework.http.converter.StringHttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>text/plain;charset=UTF-8</value>
<value>text/html;charset=UTF-8</value>
</list>
</property>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  spring-mvc 中文乱码