101 lines
4.5 KiB
XML
101 lines
4.5 KiB
XML
|
|
<?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:mvc="http://www.springframework.org/schema/mvc"
|
|||
|
|
xmlns:aop="http://www.springframework.org/schema/aop"
|
|||
|
|
xmlns:util="http://www.springframework.org/schema/util"
|
|||
|
|
xmlns:context="http://www.springframework.org/schema/context"
|
|||
|
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
|||
|
|
http://www.springframework.org/schema/beans/spring-beans.xsd
|
|||
|
|
http://www.springframework.org/schema/mvc
|
|||
|
|
http://www.springframework.org/schema/mvc/spring-mvc.xsd
|
|||
|
|
http://www.springframework.org/schema/util
|
|||
|
|
http://www.springframework.org/schema/util/spring-util.xsd
|
|||
|
|
http://www.springframework.org/schema/aop
|
|||
|
|
http://www.springframework.org/schema/aop/spring-aop.xsd
|
|||
|
|
http://www.springframework.org/schema/context
|
|||
|
|
http://www.springframework.org/schema/context/spring-context.xsd">
|
|||
|
|
|
|||
|
|
<context:component-scan base-package="com.mobile,com._3e,com.univ3e" use-default-filters="false">
|
|||
|
|
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
|
|||
|
|
<context:include-filter type="annotation" expression="org.springframework.stereotype.Component"/>
|
|||
|
|
<!-- <context:include-filter type="annotation" expression="org.springframework.beans.factory.annotation.Autowired"/> -->
|
|||
|
|
</context:component-scan>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<!--实现InitializingBean接口,然后交由spring容器管理-->
|
|||
|
|
<bean class="com.mobile.common.listener.SysInitListener"></bean>
|
|||
|
|
|
|||
|
|
<mvc:annotation-driven>
|
|||
|
|
<mvc:argument-resolvers>
|
|||
|
|
<bean class="com.mobile.resolver.ReqInfoBeanResolver"/>
|
|||
|
|
<bean class="com.mobile.resolver.ReqDataBeanResolver"/>
|
|||
|
|
<bean class="com.mobile.resolver.ReqDynamicBeanResolver"/>
|
|||
|
|
<bean class="com._3e.resolver._3EReqUserResolver"/>
|
|||
|
|
</mvc:argument-resolvers>
|
|||
|
|
<mvc:message-converters>
|
|||
|
|
<bean class="org.springframework.http.converter.StringHttpMessageConverter">
|
|||
|
|
<property name="supportedMediaTypes">
|
|||
|
|
<list>
|
|||
|
|
<value>text/plain;charset=UTF-8</value>
|
|||
|
|
<value>text/html;charset=UTF-8</value>
|
|||
|
|
</list>
|
|||
|
|
</property>
|
|||
|
|
</bean>
|
|||
|
|
<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
|
|||
|
|
<property name="supportedMediaTypes">
|
|||
|
|
<list>
|
|||
|
|
<value>application/json;charset=UTF-8</value>
|
|||
|
|
<value>text/plain;charset=UTF-8</value>
|
|||
|
|
</list>
|
|||
|
|
</property>
|
|||
|
|
<property name="objectMapper">
|
|||
|
|
<bean class="com.mobile.common.utils.ObjectMappingCustomer"></bean>
|
|||
|
|
</property>
|
|||
|
|
</bean>
|
|||
|
|
</mvc:message-converters>
|
|||
|
|
</mvc:annotation-driven>
|
|||
|
|
|
|||
|
|
<aop:aspectj-autoproxy />
|
|||
|
|
|
|||
|
|
<!-- 对静态资源文件的访问 -->
|
|||
|
|
<mvc:default-servlet-handler/>
|
|||
|
|
|
|||
|
|
<mvc:interceptors>
|
|||
|
|
<bean class="com.mobile.adapter.LogHandlerInterceptorAdapter" />
|
|||
|
|
</mvc:interceptors>
|
|||
|
|
|
|||
|
|
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter">
|
|||
|
|
<!--线程安全的访问session-->
|
|||
|
|
<property name="synchronizeOnSession" value="true"/>
|
|||
|
|
</bean>
|
|||
|
|
<bean id="multipartResolver" class="org.springframework.web.multipart.support.StandardServletMultipartResolver">
|
|||
|
|
<!--<property name="defaultEncoding" value="utf-8" />
|
|||
|
|
<property name="maxUploadSize" value="999999999" />
|
|||
|
|
<property name="maxInMemorySize" value="1024" />
|
|||
|
|
<property name="uploadTempDir" value="upload/temp" />-->
|
|||
|
|
</bean>
|
|||
|
|
|
|||
|
|
<bean id="exceptionResolver" class="com.mobile.resolver.MobileExceptionResolver"/>
|
|||
|
|
|
|||
|
|
<!-- mybatis 新增 开启spring-mvc 注解 -->
|
|||
|
|
<!-- 避免IE执行AJAX时,返回JSON出现下载文件 -->
|
|||
|
|
<!-- <bean id="mappingJacksonHttpMessageConverter" -->
|
|||
|
|
<!-- class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"> -->
|
|||
|
|
<!-- <property name="supportedMediaTypes"> -->
|
|||
|
|
<!-- <list> -->
|
|||
|
|
<!-- <value>text/html;charset=UTF-8</value> -->
|
|||
|
|
<!-- </list> -->
|
|||
|
|
<!-- </property> -->
|
|||
|
|
<!-- </bean> -->
|
|||
|
|
|
|||
|
|
<!-- 启动Spring MVC的注解功能,完成请求和注解POJO的映射 -->
|
|||
|
|
<!-- <bean -->
|
|||
|
|
<!-- class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"> -->
|
|||
|
|
<!-- <property name="messageConverters"> -->
|
|||
|
|
<!-- <list> -->
|
|||
|
|
<!-- <ref bean="mappingJacksonHttpMessageConverter" />json转换器 -->
|
|||
|
|
<!-- </list> -->
|
|||
|
|
<!-- </property> -->
|
|||
|
|
<!-- </bean> -->
|
|||
|
|
</beans>
|