| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <?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:p="http://www.springframework.org/schema/p"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:aop="http://www.springframework.org/schema/aop" xmlns:util="http://www.springframework.org/schema/util"
- xmlns:tx="http://www.springframework.org/schema/tx" 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-4.0.xsd
- http://www.springframework.org/schema/aop
- http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
- http://www.springframework.org/schema/mvc
- http://www.springframework.org/schema/mvc/spring-mvc.xsd
- http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
- http://www.springframework.org/schema/util
- http://www.springframework.org/schema/util/spring-util.xsd"
- default-autowire="byName">
- <bean id="baseUtil" class="com.mes.core.BaseUtil"></bean>
- <util:properties id="about">
- <prop key="defaultSob">MES_ZZ</prop><!-- 默认帐套名称 --><!-- 集团中心名称 -->
- <prop key="task.status">true</prop>
- </util:properties>
- <mvc:resources mapping="/resources/**" location="/resources/" />
- <mvc:default-servlet-handler />
- <!-- 自动扫描 ,把作了注解的类转换为bean -->
- <aop:aspectj-autoproxy />
- <context:property-placeholder location="WEB-INF/spring:*.properties" />
- <context:component-scan base-package="com" />
- <!-- 事务 -->
- <tx:annotation-driven />
- <bean id="transactionManager"
- class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
- <property name="dataSource" ref="dataSource" />
- </bean>
- <tx:annotation-driven transaction-manager="transactionManager" />
- <!-- 对模型视图名称的解析,在请求时模型视图名称添加前后缀 -->
- <bean
- class="org.springframework.web.servlet.view.InternalResourceViewResolver"
- p:prefix="/jsps/" p:suffix=".jsp"><!-- 指向的页面在jsps目录下,并且为.jsp文件 -->
- <property name="order" value="0" />
- </bean>
- <bean id="jsonHttpMessageConverter"
- class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
- </bean>
- <bean
- class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
- <property name="messageConverters">
- <util:list id="beanList">
- <ref bean="jsonHttpMessageConverter" /><!-- spring对list自动转成json的机制 -->
- </util:list>
- </property>
- </bean>
- <!-- 国际化 -->
- <bean id="messageSource"
- class="org.springframework.context.support.ResourceBundleMessageSource">
- <property name="basenames">
- <list>
- <value>i18n/messages</value><!-- 找src下i18n目录下文件名为messages*的所有properties文件 -->
- </list>
- </property>
- <property name="useCodeAsDefaultMessage" value="true" />
- </bean>
- <!-- Configure the multipart resolver -->
- <bean id="multipartResolver"
- class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
- <!-- one of the properties available; the maximum file size in bytes -->
- <property name="maxUploadSize" value="104857600" />
- </bean>
-
- <!-- 自定义拦截器 -->
- <mvc:interceptors>
- <mvc:interceptor>
- <mvc:mapping path="/*/**"></mvc:mapping>
- <bean class="com.mes.core.interceptor.DbSourceInterceptor"></bean><!-- MultiDataSource Interceptor -->
- </mvc:interceptor>
- </mvc:interceptors>
-
-
- <mvc:annotation-driven />
- <import resource="db-config.xml" />
- </beans>
|