首页 > Web开发 > 详细

@ResponseBody 返回中文乱码问题解决 spingmvc

时间:2016-07-21 09:50:47      阅读:362      评论:0      收藏:0      [点我收藏+]
<!-- UTF8解决乱码问题 -->
	    <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter">  
        <property name="messageConverters">  
            <list>  
                <bean class="org.springframework.http.converter.StringHttpMessageConverter">  
                    <property name="supportedMediaTypes">  
                        <list>  
                            <value>text/html;charset=UTF-8</value>  
                        </list>  
                    </property>  
                </bean>  
            </list>  
        </property>  
    </bean>  

 sping-mvc.xml 中增加上面的代码,放到mvc:annotation-driven 节点上面,问题解决!

@ResponseBody 返回中文乱码问题解决 spingmvc

原文:http://www.cnblogs.com/hoge/p/5690572.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!