zoukankan      html  css  js  c++  java
  • json乱码问题全配置

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:context="http://www.springframework.org/schema/context"
           xmlns:mvc="http://www.springframework.org/schema/mvc"
           xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/context
            http://www.springframework.org/schema/context/spring-context.xsd
            http://www.springframework.org/schema/mvc
            http://www.springframework.org/schema/mvc/spring-mvc.xsd">
        <context:component-scan base-package="com.nbg.controller"/>
        <!--json乱码问题全配置-->
        <mvc:annotation-driven>
            <mvc:message-converters register-defaults="true">
                <bean class="org.springframework.http.converter.StringHttpMessageConverter">
                    <constructor-arg value="UTF-8"/>
                </bean>
                <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
                    <property name="objectMapper">
                        <bean class="org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean">
                            <property name="failOnEmptyBeans" value="false"/>
                        </bean>
                    </property>
                </bean>
            </mvc:message-converters>
        </mvc:annotation-driven>
        <mvc:default-servlet-handler/>
        <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <property name="prefix" value="WEB-INF/jsp/"/>
            <property name="suffix" value=".jsp"/>
        </bean>
    
    </beans>
  • 相关阅读:
    TCP三次握手和四次挥手
    shell脚本进阶
    shell脚本编程基础
    centos6/7通用查看系统版本
    OSI与TCP/IP网络模型分层
    RAID基础知识总结
    yum的初步了解与使用
    Red Hat Enterprise Linux 官方正式版镜像下载
    MYSQL的基本使用,以及错误代码的意思
    人生第一次研读MFC截图工具的笔记心得
  • 原文地址:https://www.cnblogs.com/NBG-SDL/p/14161081.html
Copyright © 2011-2022 走看看