123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- <?xml version="1.0" encoding="utf-8"?>
- <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
- <beans>
- <!-- 配置文件加载 -->
- <bean id="propertyConfigure" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
- <property name="locations">
- <list>
- <value>WEB-INF/config/dbconfig.properties</value>
- </list>
- </property>
- </bean>
- <!-- 数据源配置 -->
- <bean id="dataSourceW" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
- <property name="driverClassName">
- <value>${jdbc.driverClassName}</value>
- </property>
- <property name="url">
- <value>${jdbc.url}</value>
- </property>
- <property name="username">
- <value>${jdbc.username}</value>
- </property>
- <property name="password">
- <value>${jdbc.password}</value>
- </property>
- <property name="maxActive">
- <value>${maxActive}</value>
- </property>
- <property name="maxWait">
- <value>${maxWait}</value>
- </property>
- <property name="maxIdle">
- <value>${maxIdle}</value>
- </property>
- <property name="validationQuery">
- <value>${validationQuery}</value>
- </property>
- </bean>
-
- <bean id="dataSourceR1" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
- <property name="driverClassName">
- <value>${jdbc.driverClassName}</value>
- </property>
- <property name="url">
- <value>${jdbc.url.r1}</value>
- </property>
- <property name="username">
- <value>${jdbc.username.r1}</value>
- </property>
- <property name="password">
- <value>${jdbc.password.r1}</value>
- </property>
- <property name="maxActive">
- <value>${maxActive.r1}</value>
- </property>
- <property name="maxWait">
- <value>${maxWait.r1}</value>
- </property>
- <property name="maxIdle">
- <value>${maxIdle.r1}</value>
- </property>
- <property name="validationQuery">
- <value>${validationQuery.r1}</value>
- </property>
- </bean>
-
- <bean id="dataSource" class="com.huimv.busi.xt.utils.MultipleDataSource">
- <property name="defaultTargetDataSource" ref="dataSourceW"/>
- <property name="targetDataSources">
- <map>
- <entry key="dataSourceW" value-ref="dataSourceW"/>
- <entry key="dataSourceR1" value-ref="dataSourceR1"/>
- </map>
- </property>
- </bean>
-
- <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
- <property name="dataSource" ref="dataSource"/>
- </bean>
-
- <!-- 业务逻辑层提供事务管理 -->
- <bean id="transactionProxyFactoryBean"
- class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
- lazy-init="true" abstract="true">
- <property name="transactionManager"><ref bean="transactionManager"/></property>
- <property name="transactionAttributes">
- <props>
- <prop key="save*">PROPAGATION_REQUIRED</prop>
- <prop key="insert*">PROPAGATION_REQUIRED</prop>
- <prop key="add*">PROPAGATION_REQUIRED</prop>
- <prop key="update*">PROPAGATION_REQUIRED</prop>
- <prop key="edit*">PROPAGATION_REQUIRED</prop>
- <prop key="delete*">PROPAGATION_REQUIRED</prop>
- <prop key="enable*">PROPAGATION_REQUIRED</prop>
-
- <!--
- <prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
- -->
- </props>
- </property>
- </bean>
-
- <!-- jsp+Velocity双视图解析 -->
- <bean id="viewResolver" class="com.huimv.busi.xt.utils.MultipleViewResolver">
- <property name="resolvers">
- <map>
- <entry key="jsp">
- <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
- <property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
- <property name="prefix">
- <value>/views/</value>
- </property>
- </bean>
- </entry>
-
- <entry key="htm">
- <bean class="org.springframework.web.servlet.view.velocity.VelocityViewResolver">
- <property name="contentType"><value>text/html;charset=utf-8</value></property>
- <property name="dateToolAttribute"><value>dateTool</value></property>
- <property name="numberToolAttribute"><value>numberTool</value></property>
- </bean>
- </entry>
-
- <entry key="html">
- <bean class="org.springframework.web.servlet.view.velocity.VelocityViewResolver">
- <property name="contentType"><value>text/html;charset=utf-8</value></property>
- <property name="dateToolAttribute"><value>dateTool</value></property>
- <property name="numberToolAttribute"><value>numberTool</value></property>
- </bean>
- </entry>
- </map>
- </property>
- </bean>
-
- <!-- Spring+Velocity集成配置 -->
- <bean id="velocityConfigurer"
- class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
- <property name="resourceLoaderPath" value="/views/" />
- <property name="velocityProperties">
- <props>
- <prop key="input.encoding">utf-8</prop>
- <prop key="output.encoding">utf-8</prop>
- </props>
- </property>
- </bean>
-
- <!-- Spring数据上传集成配置 -->
- <bean id="multipartResolver"
- class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
- <property name="maxUploadSize"><value>10485760</value></property>
- <property name="maxInMemorySize"><value>4096</value></property>
- </bean>
-
- <!-- 截获系统抛出的异常 -->
- <bean id="HMSException" class="com.huimv.busi.xt.utils.HMSException" />
-
- <!-- 各子系统的ibatis的ORMapping主控文件 -->
- <import resource="huimv-mapping-context.xml" />
- <!-- 各子系统的spring主控文件 -->
- <import resource="huimv-spring-context.xml" />
- <!-- 各子系统的controller主控文件 -->
- <import resource="huimv-controller-context.xml" />
- </beans>
|