慕斯8113219
2019-10-24 17:12
@Pointcut("within(com.imooc.service.sub.*)")//拦截类
public void matchType(){
System.out.println("matchType()方法执行进入");
}
@Before("matchType()")
public void befor(){
System.out.println("开始==========");
}
这个方法不处理什么逻辑,主要用于被注解一个@Pointcut(),你可以理解这个方法就是切入点本身。
你也可以不写这个方法,直接在before 增强处写 切入点 例如
@Before("within(com.imooc.service.sub.*)")
public ovid before(){
System.out.println("开始===========")
}
探秘Spring AOP
61195 学习 · 64 问题
相似问题