相同切入點的抽取spring
@Pointcut(value="execution(* com.zong.spring.User.add(..))") public void pointcut1(){ } @Before(value="pointcut1()") public void before(){ } @After(value="pointcut1()") public void after(){}
通知的優先級:
當多個加強類對同一個方法進行加強時,使用@Order註解添加在加強類上面表示優先級,數字越小優先級越高code
@Component @Aspect @Order(1) public class Proxy1{ } @Component @Aspect @Order(3) public class Proxy2{ }