81,091
社区成员
发帖
与我相关
我的任务
分享
<aop:config>
<aop:pointcut id="allServiceMethod"
expression="execution(* com.test.erp.test.action.*.*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="allServiceMethod" />
</aop:config>
<bean class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
@Resource
private HibernateTemplate ht;
<aop:config>
<aop:pointcut id="allServiceMethod"
expression="(execution(* com.test.erp.core.service.impl.*.*(..)) or
execution(* com.test.erp.test.service.impl.*.*(..)) or
execution(* com.test.erp.test.action.*.*(..)) )" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="allServiceMethod" />
</aop:config>
<bean id="ht" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
execution(* com.test.erp.test.action.*.*(..))
)后, ht 注入不进去,求高手解答@Aspect
@Component
public class BeforeAdvice{
@Pointcut("execution(* com.test.erp.test.action.*.*(..))")
public void rolePoint(){}
@Before("rolePoint()")
public void beforeAdvice() {
System.out.println("before advice is executed!");
}
}