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

                           实现简单的方法

                  };   

                    }                     

  • 相关阅读:
    纯js实现字符串formate方法
    C#实现json压缩和格式化
    简单的前端校验框架实现
    快速拷贝文件
    0012 移除元素
    0011 删除链表的倒数第N个节点
    0010 最长公共前缀
    0009 合并两个有序链表
    0008 合并K个排序链表
    0007 回文数
  • 原文地址:https://www.cnblogs.com/chencn/p/12337268.html
Copyright © 2011-2022 走看看