<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd"> <!-- 配置bean -->
<bean id="atithmeticCalculator" class="com.tanlei.spring.bean.xml.AtithmeticCalculatorImpl"></bean> <!-- 配置切面的bean -->
<bean id="loggingAspectj" class="com.tanlei.spring.bean.xml.LoggingAspectj"> </bean> <bean id="vlidationAspect" class="com.tanlei.spring.bean.xml.VlidationAspect"> </bean> <!-- 配置Aop -->
<aop:config>
<!-- 配置切点表达式 -->
<aop:pointcut expression="execution(* com.tanlei.spring.bean.xml.AtithmeticCalculator.*(int,int))" id="pointcut"/>
<!-- 配置切面及通知 -->
<aop:aspect ref="loggingAspectj" order="2">
<aop:before method="beforeMethod" pointcut-ref="pointcut"/>
<aop:after method="afterMethod" pointcut-ref="pointcut"/>
<aop:after-throwing method="logAfterThrowing" pointcut-ref="pointcut" throwing="error"/>
<aop:after-returning method="afterReturningMethod" pointcut-ref="pointcut" returning="result"/>
<aop:around method="logAround" pointcut-ref="pointcut"/>
</aop:aspect>
<aop:aspect ref="vlidationAspect" order="1">
<aop:before method="vlidationAspect" pointcut-ref="pointcut"/>
</aop:aspect>
</aop:config>
</beans>

Spring_Aop基于配置文件的更多相关文章

  1. Spring AOP基于配置文件的面向方法的切面

    Spring AOP基于配置文件的面向方法的切面 Spring AOP根据执行的时间点可以分为around.before和after几种方式. around为方法前后均执行 before为方法前执行 ...

  2. 基于配置文件的Spring注入

    基于配置文件的Spring注入 1.依赖注入的概述 依赖注入指的是通过Spring配置文件的方式创建对象时,直接通过配置的方式将数据注入到该对象的标量类型属性,并从Spring容器中获取指定对象注入到 ...

  3. spring Quartz基于配置文件和注解的实现

    这里仅仅是做简单的记录怎样实现. 一.基于配置文件的实现 ①编写须要调度的类 package com.study; import org.springframework.scheduling.anno ...

  4. Spring(二十):Spring AOP(四):基于配置文件的方式来配置 AOP

    基于配置文件的方式来配置 AOP 前边三个章节<Spring(十七):Spring AOP(一):简介>.<Spring(十八):Spring AOP(二):通知(前置.后置.返回. ...

  5. Spring:基于配置文件的创建对象的各种方式

    在Spring3.0之前,Spring主要创建对象的方法是基于配置文件的,即在配置文件中为对象进行注册,并且可以在配置文件当中为对象的字段或者称之为属性值进行赋值,接下来首先介绍基于配置文件的创建对象 ...

  6. [原创]java WEB学习笔记108:Spring学习---基于配置文件的形式实现AOP

    本博客的目的:①总结自己的学习过程,相当于学习笔记 ②将自己的经验分享给大家,相互学习,互相交流,不可商用 内容难免出现问题,欢迎指正,交流,探讨,可以留言,也可以通过以下方式联系. 本人互联网技术爱 ...

  7. 基于配置文件(xml)的S2S3H3搭建

    本次环境选择:JDK1.6+MySQL数据库+C3P0连接池+(struts2,spring3,hibernate3) 首先,创建WEB工程 然后倒入相关jar包(maven项目,在pom.xml中导 ...

  8. mongoDB在windows下基于配置文件的安装和权限配置方式

    下载mongoDB  http://www.mongodb.org/downloads 根据操作系统,选择需要下载的安装包 添加mongodb 安装目录 将解压的文件夹中内容拷贝,存放在想要安装的文件 ...

  9. ssh伪登陆执行远程主机脚本命令 C程序基于ssh passwordless执行远程主机命令及基于配置文件的验证伪登陆执行命令

    1,基于有密码及免秘钥在远程主机上执行命令及脚本 ssh -T ip "CLI or shell.sh"; 2,C程序实现上述功能--基于password-less

随机推荐

  1. skyline(TG,arcgis server)BS系统部署

    skyline的BS系统部署,正常情况下应该是TG来统一管理,SFS对矢量数据服务进行管理.但我们一直是试用许可安装的TG,发现SFS要么安装不成功,要么就是不稳定.对于Fly工程可以通过Publis ...

  2. 【Redis缓存机制】1.Redis介绍和使用场景

    (1)持久化数据库的缺点平常我们使用的关系型数据库有Mysql.Oracle以及SqlServer等,在开发的过程中,数据通常都是通过Web提供的数据库驱动来链接数据库进行增删改查. 那么,我们日常使 ...

  3. vue 路由(二级)配置及详细步骤

    1.安装插件(可以选择在初始化项目的时候安装) cnpm install vue-router --save-dev 2.将插件全局引入到项目中(main.js) import VueRouter f ...

  4. MySQL-Utilities:mysqldiff

    园子看到使用MySQL对比数据库表结构,参考测试发现 mysql> use test; create table test1 (id int not null primary key, a ) ...

  5. Dom直接选择器

    Dom直接选择器 <!DOCTYPE html> <!--Dom间接选择器--> <html lang="en"> <head> & ...

  6. mac 安装svn

    别人说用Xcode装,我也不知道我这个是不是用Xcode装的 在命令行界面输入 sudo bash svn --version 会出现一大段介绍,关于xcode的,我也不懂,一只敲空格键到最后,然后输 ...

  7. js的模块化写法

    记得前两天自己写一个动画首页,动画很复杂,我用的fullpage虽然相对比较简单,但是每个页面的animation各有差异,需要相对控制,估计有上千行的js代码,写的心情乱糟糟的. 如何让代码量巨大, ...

  8. oracle习题-简单查询

    题一 1 实现将已知表中的数据插入到另一个表中 学生表:stu1 向表中插入两条数据   学生信息表2:stuinfo 将stu1表中的两条数据导入到stuinfo表中,执行下列语句 此时查看一下st ...

  9. IO 性能 $ iostat -kx 2$ vmstat 2 10$ mpstat 2 10$ dstat --top-io --top-bio

    这些命令对于调试后端性能非常有用. 检查磁盘使用量:服务器硬盘是否已满?  是否开启了swap交换模式 (si/so)? CPU被谁占用:系统进程? 用户进程? 虚拟机? dstat 是我的最爱.用 ...

  10. Struts_登录练习(配置拦截器)

    需求:类似过滤器看有没有登录,没登陆就返回登陆界面,在上文基础上实现 1.新建拦截器 2.配置拦截器 3.完成.