我是这样配的:<bean id="txProxyTemplate" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager" ref="myTransactionManager" />
<property name="transactionAttributes">
<props>
<prop key="save*">PROPAGATION_REQUIRED</prop>
<prop key="remove*">PROPAGATION_REQUIRED</prop>
<prop key="modify*">PROPAGATION_REQUIRED</prop>
<prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean> <!-- Service primary business object implementation -->
<bean id="service" parent="txProxyTemplate">
<property name="target">
<bean class="service.BaseService">
<property name="DAO" ref="dao" />
</bean>
</property>
</bean>
<bean id="staffService" parent="txProxyTemplate">
<property name="target">
<bean class="service.impl.StaffServiceImpl">
<property name="DAO" ref="dao" />
<property name="staffDao" ref="staffDao" />
</bean>
</property>
</bean>
再在action里面通过
ServletContext servletContext = actionServlet.getServletContext();
WebApplicationContext wac =
WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
this.staffService = (StaffService) wac.getBean("staffService");调用的