MySQL中文正常而mybatis查询出现乱码的解决方案

解决方案是在spring-mvc.xml文件中,加入

<mvc:annotation-driven>
        <mvc:message-converters>
            <bean class="org.springframework.http.converter.StringHttpMessageConverter">
                <property name="supportedMediaTypes">
                    <list>
                        <value>application/json;charset=UTF-8</value>
                        <value>text/html;charset=UTF-8</value>
                    </list>
                </property>
            </bean>
        </mvc:message-converters>
    </mvc:annotation-driven>

乱码几个层次的几种解决方案总结待补

猜你喜欢

转载自www.cnblogs.com/zxcoder/p/11898403.html