- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<!--实际实现类-->
- <!--注入sessionFactory-->
- <property name="sessionFactory">
- <ref local="sessionFactory" />
- </property>
- </bean>
<!-- 配置事务管理器 -->
- <bean id="transactionManager"
- class="<SPAN style="COLOR: #000000">org.springframework.orm.hibernate3.HibernateTransactionManager</SPAN>">
- <!--注入sessionFactory-->
- <property name="sessionFactory">
- <ref local="sessionFactory" />
- </property>
- </bean>
<!-- 配置事务管理模板 -->
- <bean id="CdaoProxy"
- class="<SPAN style="COLOR: #000000">org.springframework.transaction.interceptor.TransactionProxyFactoryBean</SPAN>">
- <!--注入事务管理器-->
- <property name="transactionManager">
- <ref local="transactionManager" />
- </property>
- <!--设置target对应类-->
- <property name="target">
- <ref local="cdao" />
- </property>
- <!-- 设置事务属性-->
- <property name="transactionAttributes">
- <props>
- <prop key="save*">PROPAGATION_REQUIRED</prop>
- <prop key="update*">PROPAGATION_REQUIRED</prop>
- <prop key="delete*">PROPAGATION_REQUIRED</prop>
- <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
- <prop key="insert*">PROPAGATION_REQUIRED</prop>
- </props>
- </property>
- </bean>
<!-- 配置action,注入 业务实现类-->
- <bean name="/login" class="com.wxy.struts.action.LoginAction">
- <property name="icdao">
- <ref local="cdao" />
- </property>
- </bean>
- <bean name="/register"
- class="com.wxy.struts.action.RegisterAction">
- <property name="icdao">
- <ref local="cdao" />
- </property>
- </bean>
- <bean name="/cun" class="com.wxy.struts.action.CunAction">
- <property name="icdao">
- <ref local="cdao" />
- </property>
- </bean>
- <bean name="/qukuan" class="com.wxy.struts.action.QukuanAction">
- <property name="icdao">
- <ref local="cdao" />
- </property>
- </bean>
<!--定义一个hibernate的SessionFactory-->
- <bean id="sessionFactory"
- class="<SPAN style="COLOR: #000000">org.springframework.orm.hibernate3.LocalSessionFactoryBean</SPAN>">
- <property name="configLocation">
- <value<SPAN style="COLOR: #000000">>/WEB-INF/hibernate.cfg.xml</SPAN></value>
- </property><