首先配置摸板
<!-- 代理模板 -->
<bean id="txProxy" lazy-init="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" abstract="true">
<property name="transactionManager"><ref local="transactionManager"/></property>
<property name="transactionAttributes">
<props>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
摸板配置好以后,每次要添加一個新的代理,只需要類似下面這樣添加
<bean id="servicerProxy" parent="txProxy">
<property name="target">
<ref local="serviceTarget"/>
</property>
</bean>
從而大大簡化了代理的配置
posted on 2005-12-13 10:25
snoics 閱讀(632)
評論(0) 編輯 收藏 所屬分類:
學習 . 感悟