12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?xml version="1.0" encoding="UTF-8"?>
- <beans default-lazy-init="false"
- 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:util="http://www.springframework.org/schema/util"
- xmlns:mvc="http://www.springframework.org/schema/mvc"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context.xsd
- http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
- http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd"
- >
- <!--业务Beans, 使用注解方式配置-->
- <context:component-scan base-package="com.yihu">
- <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
- </context:component-scan>
- <!--====================返回为null的时候转“”==========================-->
- <mvc:annotation-driven>
- <mvc:message-converters register-defaults="true">
- <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
- <property name="objectMapper">
- <bean class="com.fasterxml.jackson.databind.ObjectMapper">
- <property name="serializationInclusion">
- <value type="com.fasterxml.jackson.annotation.JsonInclude.Include">NON_NULL</value>
- </property>
- </bean>
- </property>
- </bean>
- </mvc:message-converters>
- </mvc:annotation-driven>
- <bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
- <property name="cookieMaxAge" value="604800"/>
- <property name="defaultLocale" value="zh_CN"/>
- <property name="cookieName" value="Language"></property>
- </bean>
- <bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor"/>
- </beans>
|