切入点表达式

execution()  用于描述方法 【掌握】

       语法:execution(修饰符  返回值  包.类.方法名(参数) throws异常)

              修饰符,一般省略

                     public             公共方法

                     *                   任意

              返回值,不能省略

                     void               返回没有值

                     String             返回值字符串

                     *                   任意

              包,[省略]

                     com.qf.crm                   固定包

                     com.qf.crm.*.service       crm包下面子包任意 (例如:com.qf.crm.staff.service)

                     com.qf.crm..                    crm包下面的所有子包(含自己)

                     com.qf.crm.*.service..     crm包下面任意子包,固定目录service,service目录任意包

              类,[省略]

                     UserServiceImpl                    指定类

                     *Impl                                  以Impl结尾

                     User*                                  以User开头

                     *                                        任意

              方法名,不能省略

                     addUser                               固定方法

                     add*                                    以add开头

                     *Do                                    以Do结尾

                     *                                        任意

              (参数)

                     ()                                        无参

                     (int)                                    一个整型

                     (int ,int)                               两个

                     (..)                                      参数任意

              throws ,可省略,一般不写。

 

综合1

       execution(* com.qf.crm.*.service..*.*(..))

综合2

       <aop:pointcut expression="execution(* com.qf.*WithCommit.*(..)) ||

                          execution(* com.qf.*Service.*(..))" id="myPointCut"/>

2.within:匹配包或子包中的方法(了解)

       within(com.qf.aop..*)

3.this:匹配实现接口的代理对象中的方法(了解)

       this(com.qf.aop.user.UserDAO)

4.target:匹配实现接口的目标对象中的方法(了解)

       target(com.qf.aop.user.UserDAO)

5.args:匹配参数格式符合标准的方法(了解)

       args(int,int)

6.bean(id)  对指定的bean所有的方法(了解)

       bean('userServiceId')

 

转载于:https://my.oschina.net/u/3714511/blog/1556761

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值