Spring_Aop基于配置文件
<?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基于配置文件的更多相关文章
- Spring AOP基于配置文件的面向方法的切面
Spring AOP基于配置文件的面向方法的切面 Spring AOP根据执行的时间点可以分为around.before和after几种方式. around为方法前后均执行 before为方法前执行 ...
- 基于配置文件的Spring注入
基于配置文件的Spring注入 1.依赖注入的概述 依赖注入指的是通过Spring配置文件的方式创建对象时,直接通过配置的方式将数据注入到该对象的标量类型属性,并从Spring容器中获取指定对象注入到 ...
- spring Quartz基于配置文件和注解的实现
这里仅仅是做简单的记录怎样实现. 一.基于配置文件的实现 ①编写须要调度的类 package com.study; import org.springframework.scheduling.anno ...
- Spring(二十):Spring AOP(四):基于配置文件的方式来配置 AOP
基于配置文件的方式来配置 AOP 前边三个章节<Spring(十七):Spring AOP(一):简介>.<Spring(十八):Spring AOP(二):通知(前置.后置.返回. ...
- Spring:基于配置文件的创建对象的各种方式
在Spring3.0之前,Spring主要创建对象的方法是基于配置文件的,即在配置文件中为对象进行注册,并且可以在配置文件当中为对象的字段或者称之为属性值进行赋值,接下来首先介绍基于配置文件的创建对象 ...
- [原创]java WEB学习笔记108:Spring学习---基于配置文件的形式实现AOP
本博客的目的:①总结自己的学习过程,相当于学习笔记 ②将自己的经验分享给大家,相互学习,互相交流,不可商用 内容难免出现问题,欢迎指正,交流,探讨,可以留言,也可以通过以下方式联系. 本人互联网技术爱 ...
- 基于配置文件(xml)的S2S3H3搭建
本次环境选择:JDK1.6+MySQL数据库+C3P0连接池+(struts2,spring3,hibernate3) 首先,创建WEB工程 然后倒入相关jar包(maven项目,在pom.xml中导 ...
- mongoDB在windows下基于配置文件的安装和权限配置方式
下载mongoDB http://www.mongodb.org/downloads 根据操作系统,选择需要下载的安装包 添加mongodb 安装目录 将解压的文件夹中内容拷贝,存放在想要安装的文件 ...
- ssh伪登陆执行远程主机脚本命令 C程序基于ssh passwordless执行远程主机命令及基于配置文件的验证伪登陆执行命令
1,基于有密码及免秘钥在远程主机上执行命令及脚本 ssh -T ip "CLI or shell.sh"; 2,C程序实现上述功能--基于password-less
随机推荐
- [HEOI2016/TJOI2016]排序 线段树+二分
[HEOI2016/TJOI2016]排序 内存限制:256 MiB 时间限制:6000 ms 标准输入输出 题目类型:传统 评测方式:文本比较 题目描述 在2016年,佳媛姐姐喜欢上了数字序列.因而 ...
- Autoware显示用户界面细节
https://blog.csdn.net/jianxuezixuan/article/details/86015224
- mysql基础教程(三)-----增删改、子查询、创建管理表、约束和分页
插入 INSERT语句语法 从其它表中拷贝数据 • 不必书写 VALUES 子句. • 子查询中的值列表应与 INSERT 子句中的列名对应 update语句 • 可以一次更新多条数据. • 如果需要 ...
- CentOS 6.5 服务器相关配置
vi /etc/sysconfig/network-scripts/ifcfg-eth0 #配置网卡 ONBOOT=YES #静态IPBOOTPROTO=static #启用地址协议 --static ...
- swoole入门abc
1. 入门abc 1.1 github账号添加 第一步依然是配置git用户名和邮箱 git config user.name "用户名" git config user.email ...
- Ubuntu 解压和压缩总结
1..rar文件 一般通过默认安装的ubuntu是不能解压rar文件的,只有在安装了rar解压工具之后,才可以解压.其实在ubuntu下安装rar解压工具非常简单,下面是具体方法: ubuntu 下r ...
- tr的display属性出现td的colspan无效问题
http://www.aichengxu.com/other/9262680.htm 今天在做项目的时候发现用javascript控制 tr 的显示隐藏时,当把tr的显示由“display:none” ...
- URI、URL 和 URN的区别
关于URI:URL类似于住址,它告诉你一种寻找目标的方式. URL和URN都是URI的子集. URI规范:协议名称://域名.根域名/目录/文件名.后缀#sddf URI :Unifor ...
- Hackerrank--XOR love (Math系列)
题目链接 Devendra loves the XOR operation very much which is denoted by ∧ sign in most of the programmin ...
- Twitter web information
http://developer.51cto.com/art/201307/404612.htm 150M active users 300K Qps (read, only 6000 write/s ...