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(){

                           实现简单的方法

                  };   

                    }                     

  • 相关阅读:
    Linux进程和线程
    Vim编辑器
    Java多线程编程(七)线程状态、线程组与异常处理
    Java多线程编程(六)单例模式与多线程
    Integer to Roman
    Container With Most Water
    Regular Expression Matching
    Palindrome Number
    c/c++获取硬盘序列号
    String to Integer (atoi)
  • 原文地址:https://www.cnblogs.com/chencn/p/12337268.html
Copyright © 2011-2022 走看看