AOP注解配置

来源:互联网 发布:唐嫣直播软件 编辑:程序博客网 时间:2024/05/17 21:47
1)  在 xml 配置中启用 AoP 注解配置 
<aop:aspectj-autoproxy/> 
2)  在切面组件中使用 Aop 注解 
@Aspect 表示该组件是 AOP 组件

@Pointcut("within(tarena.service..*)")  用于指定切入点表达式 

@Around("servicePointcut()")  为指定的目标方法设置环绕通知处理 

@Before、@After、@AfterReturing、@AfterThrowing、@Around 

 

原创粉丝点击