本文参考至:spring-framework-reference.pdf的7.3 章节

【Schema-based AOP support】

  If you are unable to use Java 5, or simply prefer an XML-based format, then Spring 2.0 also offers
support for defining aspects using the new "aop" namespace tags. The exact same pointcut expressions
and advice kinds are supported as when using the @AspectJ style, hence in this section we will focus on
the new syntax and refer the reader to the discussion in the previous section (Section 7.2, “@AspectJ
support”) for an understanding of writing pointcut expressions and the binding of advice parameters.

  To use the aop namespace tags described in this section, you need to import the spring-aop schema as
described in Appendix C, XML Schema-based configuration. See the section called “The aop schema” for
how to import the tags in the aop namespace.

  Within your Spring configurations, all aspect and advisor elements must be placed within an
<aop:config> element (you can have more than one <aop:config> element in an application
context configuration). An <aop:config> element can contain pointcut, advisor, and aspect elements
(note these must be declared in that order).

如果,你不能使用java5,或者更倾向于使用XML格式的配置文件,Spring2.0引入了支持使用配置文件配置Aop,使用【aop】的命名空间,相同的pointCut表

答式和各种advice(before、after、around、after returning)也可以像@AspectJ中一样的使用。因而在本节中,我们将主要介绍新的语义,并且涉及到

前面的章节,更好的理解如何编写pointCut表达式和绑定advice的参数。

  要使用在本节使用aop的命名空间标签,需要参考附录C引入spring-aop的schema即-XML Schema-based configuration。

在自己的Spring配置文件中,所有的aspect和advisor标签必须至于<aop:config>标签范围内【在一个配置文件中,可以有多个<aop:config>标签】,一个

【<aop:config>】标签可以包含point、advisor、和asect元素,特别强调:元素的命名,必须要按照上述的顺序

Schema-based AOP support的更多相关文章

  1. 开涛spring3(6.3) - AOP 之 6.3 基于Schema的AOP

    6.3  基于Schema的AOP 基于Schema的AOP从Spring2.0之后通过“aop”命名空间来定义切面.切入点及声明通知. 在Spring配置文件中,所以AOP相关定义必须放在<a ...

  2. 基于@AspectJ和schema的aop(一)

    在前面我们使用Pointcut和Advice描述切点和增强, 并使用Advisor整合两者描述切面.@AspectJ使用注解来描述切点和增强.两者使用的方式不同, 但是在本质上都是一样的. 我们还是用 ...

  3. 基于Schema的AOP 配置使用详解

    原文地址:http://jinnianshilongnian.iteye.com/blog/1418598 基于Schema的AOP从Spring2.0之后通过"aop"命名空间来 ...

  4. 第三章 AOP 基于Schema的AOP

    基于Schema定义的切面和前现两种方式定义的切面,内容上都差不多,只是表现形式不一样而已. 3.7.1一般增强的使用 a.目标类 public class Target { public void ...

  5. spring aop 基于schema的aop

    AOP的基本概念: 连接点(Jointpoint):表示需要在程序中插入横切关注点的扩展点,连接点可能是类初始化.方法执行.方法调用.字段调用或处理异常等等,Spring只支持方法执行连接点,在AOP ...

  6. Error creating bean with name 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0': Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework

    昨晚在 使用spring aop, 然后Tomcat启动的时候, 报了这么个错: Caused by: org.springframework.beans.factory.BeanCreationEx ...

  7. spring3: schema的aop与Aspectj的aop的区别

    schema的aop如下: 接口: package chapter6.service; public interface IHelloAroundService { public void sayAr ...

  8. spring3: 基于Schema的AOP

    6.3  基于Schema的AOP 基于Schema的AOP从Spring2.0之后通过“aop”命名空间来定义切面.切入点及声明通知. 在Spring配置文件中,所以AOP相关定义必须放在<a ...

  9. NoClassDefFoundError: Could not initialize class org.apache.cxf.jaxrs.provider.ProviderFactory org.springframework.aop.support.AopUtils.isCglibProxyClass

    报错: 2018-05-03 10:35:20 377 ERROR org.apache.juli.logging.DirectJDKLog.log:181 - Servlet.service() f ...

随机推荐

  1. mvc3.0防止跨站点请求伪造(CSRF)攻击

    众所周知,asp.net mvc程序在浏览器运行是产生标准的Html标签,包括浏览器要发送的关键数据等内容都在html内容里面.听起来不错,但是假如我们伪造类似的html内容,更改里面的关键数据,在浏 ...

  2. 优先队列(priorityqueue)

    队列是先进先出的线性表,顾名思义,优先队列则是元素有优先级的队列,出列的顺序由元素的优先级决定.从优先队列中删除元素是根据优先权的高低次序,而不是元素进入队列的次序.优先队列的典型应用是机器调度等. ...

  3. C#获取URL参数值(NameValueCollection)

    在写程序的时候,我们经常需要对页面进行传参数,比如page?id=1234,那么在page这个页面中就直接可以使用string id = Request.QueryString["id&qu ...

  4. android系统将普通应用升级为系统应用

    作为一名程序员,有的时候并不是使用软件,而是去改造软件,不仅仅只是会编程而已,还要满足客户的需求.这样,才能开发出符合客户需求的应用,在关于到涉及到android底层的应用的时候,手机就需要root了 ...

  5. zoj 1149 Dividing

    1到6的卡分别各有有限制的张数,问能不能恰好分,总张数不能超过20000. 很明显是多重背包问题,上去果写了个三重循环,然后就T了,重新打开背包九讲,找到了多重背包的二进制拆分优化,把其中一维n的复杂 ...

  6. linux下的gdb调试工具--断点调试

    到目前为止我们的调试手段只有一种: 根据程序执行时的出错现象假设错误原因,然后在代码中适当的位置插入printf,执行程序并分析打印结果,如果结果和预期的一样,就基本上证明了自己假设的错误原因,就可以 ...

  7. 浏览器文档播放Shockwave Flash 插件问题

    浏览器被提示shockwave flash crashed怎么办?在使用浏览器的时候经常被提示shockwave flash crashed,flash插件崩溃,网页就会出现一些无法显示的文件,下面绿 ...

  8. [置顶] 学习鸟哥的Linux私房菜笔记(6)——过滤器、输入输出及管道

    一.过滤器 Linux中的应用工具分为三种: 交互工具 过滤器 编辑器 能够接受数据,过滤再输出的工具,称之为过滤器 对过滤器和进程,存在着输入源与输出对象 二.输入.输出.重定向 输入:过滤器的数据 ...

  9. Android.Hacks.01_Centering views using weights

    Android.Hacks读书笔记01 #1#权重布局之解析: LinearLayout ’s android:weightSum      LinearLayout ’s child android ...

  10. js/jquery获取当前页面URL地址并判断URL字符串中是否包含某个具体值

    js/jquery获取当前页面URL地址并判断URL字符串中是否包含某个具体值本文介绍jquery/js获取当前页面url地址的方法,在jquery与js中获取当前页面url方法是一样的,因为jque ...