spring ajax以及页面返回中文乱码问题解决

Posted 发瑞

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了spring ajax以及页面返回中文乱码问题解决相关的知识,希望对你有一定的参考价值。

在spring配置文件中添加

<!--返回中文乱码-->
    <mvc:annotation-driven >
        <!-- 消息转换器 -->
        <mvc:message-converters register-defaults="true">
            <bean class="org.springframework.http.converter.StringHttpMessageConverter">
                <property name="supportedMediaTypes" value="text/html;charset=UTF-8"/>
            </bean>
        </mvc:message-converters>
    </mvc:annotation-driven>

  

以上是关于spring ajax以及页面返回中文乱码问题解决的主要内容,如果未能解决你的问题,请参考以下文章