2019-06-02 08:43:34 +08:00
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
|
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
|
|
|
|
|
xmlns:context="http://www.springframework.org/schema/context"
|
|
|
|
|
|
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
|
|
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
|
|
|
xmlns:p="http://www.springframework.org/schema/p"
|
|
|
|
|
|
xmlns:tx="http://www.springframework.org/schema/tx"
|
|
|
|
|
|
xmlns:util="http://www.springframework.org/schema/util"
|
|
|
|
|
|
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/tx
|
|
|
|
|
|
http://www.springframework.org/schema/tx/spring-tx.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">
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Static resources -->
|
|
|
|
|
|
<!-- js images css -->
|
|
|
|
|
|
<mvc:resources mapping="/jquery/**" location="/jquery/" />
|
|
|
|
|
|
<mvc:resources mapping="/images/**" location="/images/" />
|
|
|
|
|
|
<mvc:resources mapping="/css/**" location="/css/" />
|
|
|
|
|
|
<mvc:resources mapping="/js/**" location="/js/" />
|
|
|
|
|
|
|
|
|
|
|
|
<!-- LocaleResolver -->
|
|
|
|
|
|
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
|
|
|
|
|
|
<property name="cookieDomain" value="#{applicationConfig.subDomainName}"/>
|
|
|
|
|
|
<property name="cookieName" value="single_sign_on_lang"/>
|
|
|
|
|
|
<property name="cookieMaxAge" value="604800" />
|
|
|
|
|
|
<!-- auto select language by brower remove -->
|
|
|
|
|
|
<!--<property name="defaultLocale" value="en" /> -->
|
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 消息处理,可以直接使用properties的key值,返回的是对应的value值 -->
|
|
|
|
|
|
<bean id="messageSource"
|
|
|
|
|
|
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
|
|
|
|
|
|
<property name="basenames">
|
|
|
|
|
|
<list>
|
|
|
|
|
|
<value>classpath:messages/message</value>
|
|
|
|
|
|
</list>
|
|
|
|
|
|
</property>
|
|
|
|
|
|
<!-- 必须设置成false,否则hibernate原有的校验信息无法返回value值-->
|
|
|
|
|
|
<property name="useCodeAsDefaultMessage" value="false"/>
|
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Locale Change Interceptor and Resolver definition -->
|
|
|
|
|
|
<bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
|
|
|
|
|
|
<property name="paramName" value="language" />
|
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- XML bean Marshaller define -->
|
|
|
|
|
|
<bean id="Jaxb2Marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
|
|
|
|
|
|
<property name="classesToBeBound">
|
|
|
|
|
|
<list>
|
|
|
|
|
|
<value>org.maxkey.domain.xml.UserInfoXML</value>
|
|
|
|
|
|
</list>
|
|
|
|
|
|
</property>
|
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- MarshallingHttpMessageConverter -->
|
|
|
|
|
|
<bean id="marshallingHttpMessageConverter" class="org.springframework.http.converter.xml.MarshallingHttpMessageConverter">
|
|
|
|
|
|
<property name="marshaller" ref="Jaxb2Marshaller" />
|
|
|
|
|
|
<property name="unmarshaller" ref="Jaxb2Marshaller" />
|
|
|
|
|
|
<property name="supportedMediaTypes">
|
|
|
|
|
|
<list>
|
|
|
|
|
|
<value>application/xml;charset=UTF-8</value>
|
|
|
|
|
|
</list>
|
|
|
|
|
|
</property>
|
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
|
|
<!--MappingJacksonHttpMessageConverter -->
|
|
|
|
|
|
<bean id="mappingJacksonHttpMessageConverter" class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
|
|
|
|
|
|
<property name="supportedMediaTypes">
|
|
|
|
|
|
<list>
|
|
|
|
|
|
<value>application/json;charset=UTF-8</value>
|
|
|
|
|
|
</list>
|
|
|
|
|
|
</property>
|
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- REST Client -->
|
|
|
|
|
|
<bean id="restTemplate" class="org.springframework.web.client.RestTemplate">
|
|
|
|
|
|
<property name="messageConverters">
|
|
|
|
|
|
<list>
|
|
|
|
|
|
<ref bean="marshallingHttpMessageConverter" />
|
|
|
|
|
|
<ref bean="mappingJacksonHttpMessageConverter" />
|
|
|
|
|
|
</list>
|
|
|
|
|
|
</property>
|
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- AnnotationMethodHandlerAdapter -->
|
|
|
|
|
|
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter">
|
|
|
|
|
|
<property name="messageConverters">
|
|
|
|
|
|
<util:list id="beanList">
|
|
|
|
|
|
<ref bean="marshallingHttpMessageConverter" />
|
|
|
|
|
|
<ref bean="mappingJacksonHttpMessageConverter" />
|
|
|
|
|
|
</util:list>
|
|
|
|
|
|
</property>
|
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
|
|
<bean id="handlerMapping" class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping">
|
|
|
|
|
|
<property name="interceptors">
|
|
|
|
|
|
<list>
|
|
|
|
|
|
<ref bean="localeChangeInterceptor" />
|
|
|
|
|
|
</list>
|
|
|
|
|
|
</property>
|
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
2019-09-04 23:47:22 +08:00
|
|
|
|
<!-- View Resolver
|
|
|
|
|
|
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/templates/" p:suffix=".jsp" p:order="2" />
|
|
|
|
|
|
-->
|
2019-06-02 08:43:34 +08:00
|
|
|
|
<!-- upload file support -->
|
|
|
|
|
|
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
|
|
|
|
|
|
<property name="maxUploadSize" value="4194304" />
|
|
|
|
|
|
</bean>
|
|
|
|
|
|
</beans>
|