1.切入点表达式
1.1bean表达式
说明:根据bean的ID拦截指定对象
@Pointcut("bean(userServiceImpl)")
public void pointcut(){
}
1.2within表达式
说明:按照类型匹配,可以使用通配符"*"号
1.@Pointcut("within(com.jt.service.UserServiceImpl)")
只拦截UserServiceImpl的类
2.@Pointcut("within(com.jt.service.*)")
只拦截com.jt.service下所有的类
3.@Pointcut("within(com.jt.service..*)")
拦截com.jtservice下所有包下的所有类
4.@Pointcut("within(com.*.service..*)")
以com开头service下的所有包下的所有类
说明:上述得2种操作方法粒度较粗,一般情况不用了.
1.3execution表达式
作用:粒度比较细,可以按照方法参数进行匹配.
语法:
@Pointcut("execution(返回值 包名.类名.方法名(参数列表))")
1.按照类型方法匹配
@Pointcut("execution(* com.jt.service.UserSer