struts2+hibernate+spring配置管理(一)-配置文件3
可能注意到了,这里的Action交给SPRING来管理了。所以我们看一下application.xml的代码吧
xml 代码
- xml version="1.0" encoding="UTF-8"?>
- >
- <beans>
- <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
- <property name="driverClass" value="oracle.jdbc.driver.OracleDriver" />
- <property name="jdbcUrl" value="jdbc:oracle:thin:@localhost:1521:oracleDB" />
- <property name="user" value="xxx" />
- <property name="password" value="xxx" />
- <property name="minPoolSize" value="3" />
- <property name="maxPoolSize" value="30" />
- <property name="maxIdleTime" value="1800" />
- <property name="acquireIncrement" value="3" />
- <property name="maxStatements" value="0" />
- <property name="initialPoolSize" value="3" />
- <property name="idleConnectionTestPeriod" value="60" />
- <property name="acquireRetryAttempts" value="30" />
- <property name="breakAfterAcquireFailure" value="true" />
- <property name="testConnectionOnCheckout" value="false" />
- bean>
- <bean id="sessionFactory"
- class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
- <property name="dataSource">
- <ref bean="dataSource" />
- property>
- <property name="hibernateProperties">
- <props>
- <prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialectprop>
- <prop key="hibernate.show_sql">trueprop>
- <prop key="hibernate.generate_statistics">trueprop>
- <prop key="hibernate.connection.release_mode">autoprop>
- <prop key="hibernate.autoReconnect">trueprop>
- props>
- property>
- <property name="mappingDirectoryLocations">
- <list>
- <value>
- classpath:com/caitong/pingou/bean
- value>
- list>
- property>
- bean>
- <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
- <property name="sessionFactory">
- <ref bean="sessionFactory"/>
- property>
- bean>
- &n ...