日期:2014-05-19 浏览次数:20634 次
<context:annotation-config />
<context:component-scan base-package="com.xx"/>
<bean id="xx1" class="com.xx.LogInterceptor"></bean>
<aop:config>
<aop:point-cut id="xx2" execution(public * com.xx.service..*.add(..))" />
<aop:aspect id="xx3" ref="xx1">
<aop:before method="before" point-ref="xx2"/>
</aop:aspect>
</aop:config>
<context:annotation-config />
<context:component-scan base-package="com.xx"/>
<bean id="xx1" class="com.xx.LogInterceptor"></bean>
<aop:config>
<aop:point-cut id="xx2" execution(public * com.xx.service..*.add(..))" />
<aop:advisor pointcut-ref="xx2" advice-ref="txAdvice" />
</aop:config>
<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<tx:method name="getUser" read-only="true" />
<tx:method name="add*" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice>
<bean id="txManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
sessionfactory配置此处略