springside的文檔中有aop的配置;http://wiki.springside.org.cn/display/springside/Spring+Aop
里面有關(guān)于pointcut 表達式語言的表述;

里面也有官方文檔中文版的鏈接:http://www.redsaga.com/spring_ref/2.0/html/aop.html
我們用scheme-based aop 配置方式:
 <aop:config> ......    </aop:config>

Advisor方式:
假設(shè)我們有一個MethodBeforeAdvice TestAdvice
;用于打印將要執(zhí)行的方面名;
public class TestAdvice implements MethodBeforeAdvice {

    public void before(Method method, Object[] objects, Object object)
throws Throwable {
        System.out.println("method.getName() = " + method.getName());
        System.out.println("TestAdvice testing..." );
    }

}

配置如下:
 <bean id="testAdvice"
class="biz.pxzit.application.service.TestAdvice"/>
 <aop:config>
      <aop:advisor pointcut="execution(* biz..*Mgr.save*(..))"
advice-ref="testAdvice" order="1"/>

      ......
   </aop:config>

order是可選的,指定執(zhí)行的次序;上面的配置語意是,在執(zhí)行biz開頭的package下面任意以Mgr結(jié)尾的managersave開頭的方法時候,執(zhí)行testAdvice,因為是MethodBeforeAdvice
所以在save開頭方法執(zhí)行前執(zhí)行;

Aspect方式:
public class TestAdvice2  {

    public void goAfter(JoinPoint joinPoint) throws Throwable {
        System.out.println("TestAdvice2.goAfter
testing..."+joinPoint.getTarget());
        System.out.println("TestAdvice2.goAfter testing..." );
    }

}

配置如下:

 <bean id="testAdvice2"
class="biz.pxzit.application.service.TestAdvice2"/>
 <aop:config>
           ......
            <aop:aspect id="ddAspect" ref="testAdvice2">
            <aop:after method="goAfter"
                        pointcut="execution(* biz..*Mgr.*(..))"
                />
          .......
        </aop:aspect>

   </aop:config>
注意TestAdvice2的方法參數(shù),這里用的是JoinPoint
joinPoint
,還有很多細節(jié),具體可以看文檔;
要使用<aop:aspect >節(jié)點,還需asm.jar
3個,在springframeworklib下有)否則會報noclassfound
exception

注意我之前配置的pointcut表達式是錯的,正確的是execution(*
biz..*Mgr.*(..))"