zoukankan      html  css  js  c++  java
  • Spring ---AOP(2)

    方法二:

    1.创建对象Aopdemo  方法 show(){...}

    2.添加     <bean id="aopdemo" class="com....."/>

        <aop:config > 

         <aop:aspect ref="aopdemo">

            <aop:pointcut id="os" expression="execution(* *.*(..))"/>

            <aop:before method="show"  pointcut-ref="os"/>

         </aop:aspect>

        </aop:config>

    3.方法三:注解方式

         1. XML配置添加 :<aop:autoproxy  ....>  自动代理

                <bean id="aopspect" class="com.xx.xx.Aopsect"/>

         2. 创建对象 :

                 @Aspect

                public class Aopsect{

                    @Before|@After|@Around("execute=(* com.xx.xx类.*(..))")

                    public void  show(){

                           实现简单的方法

                  };   

                    }                     

  • 相关阅读:
    hdu 5726 GCD
    codeforces 982C Cut 'em all!
    codeforces 982B Bus of Characters
    codeforces 982A Row
    codeforces 983B XOR-pyramid
    codeforces 979D Kuro and GCD and XOR and SUM
    codeforces 983A Finite or not?
    codeforces 984B Minesweeper
    codeforces 979C Kuro and Walking Route
    codeforces 979B Treasure Hunt
  • 原文地址:https://www.cnblogs.com/chencn/p/12337268.html
Copyright © 2011-2022 走看看