struts2+hibernate+spring配置管理(一)-配置文件3

可能注意到了,这里的Action交给SPRING来管理了。所以我们看一下application.xml的代码吧

xml 代码
  1. xml version="1.0" encoding="UTF-8"?>      
  2. >      
  3.      
  4. <beans>      
  5.     <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">         
  6.         <property name="driverClass" value="oracle.jdbc.driver.OracleDriver" />         
  7.         <property name="jdbcUrl" value="jdbc:oracle:thin:@localhost:1521:oracleDB" />         
  8.         <property name="user" value="xxx" />         
  9.         <property name="password" value="xxx" />              
  10.                    
  11.         <property name="minPoolSize" value="3" />       
  12.                 
  13.         <property name="maxPoolSize" value="30" />       
  14.                       
  15.         <property name="maxIdleTime" value="1800" />       
  16.                       
  17.         <property name="acquireIncrement" value="3" />        
  18.         <property name="maxStatements" value="0" />         
  19.         <property name="initialPoolSize" value="3" />         
  20.               
  21.         <property name="idleConnectionTestPeriod" value="60" />         
  22.               
  23.         <property name="acquireRetryAttempts" value="30" />         
  24.         <property name="breakAfterAcquireFailure" value="true" />             
  25.         <property name="testConnectionOnCheckout" value="false" />         
  26.     bean>      
  27.           
  28.     <bean id="sessionFactory"     
  29.         class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">      
  30.         <property name="dataSource">      
  31.             <ref bean="dataSource" />      
  32.         property>      
  33.         <property name="hibernateProperties">      
  34.             <props>      
  35.                 <prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialectprop>      
  36.                 <prop key="hibernate.show_sql">trueprop>      
  37.                 <prop key="hibernate.generate_statistics">trueprop>      
  38.                 <prop key="hibernate.connection.release_mode">autoprop>      
  39.                 <prop key="hibernate.autoReconnect">trueprop>                   
  40.             props>      
  41.         property>      
  42.         <property name="mappingDirectoryLocations">       
  43.         <list>      
  44.             <value>      
  45.                  classpath:com/caitong/pingou/bean      
  46.             value>      
  47.         list>                               
  48.         property>      
  49.     bean>       
  50.           
  51.     <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">          
  52.           <property name="sessionFactory">          
  53.               <ref bean="sessionFactory"/>          
  54.           property>          
  55.     bean>        
  56.      &n ...
posted @ 2008-10-24 20:59  Earl_86  阅读(202)  评论(0编辑  收藏  举报