Spring AOP 代理配置笔记
来源:互联网 发布:mac dota2 鼠标巨大 编辑:程序博客网 时间:2024/05/19 22:24
<?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:context="http://www.springframework.org/schema/context"xmlns:aop="http://www.springframework.org/schema/aop"xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"><!-- 打开Spring的Annotation的支持 --><!-- AutowiredAnnotationBeanPostProcessor、CommonAnnotationBeanPostProcessor、 PersistenceAnnotationBeanPostProcessor 以及 RequiredAnnotationBeanPostProcessor 这 4 个BeanPostProcessor。 注册这4个 BeanPostProcessor的作用,就是为了系统能够识别相应的注解。 --><!-- <context:annotation-config /> --><!-- 告诉Spring去哪些包中找Annotation --><!-- <context:component-scan base-package="boa.framework" /> --><context:component-scan base-package="boa.framework.controller" /><context:component-scan base-package="boa.framework.service" /><context:component-scan base-package="boa.framework.aspect" /><context:component-scan base-package="boa.framework.dao" /><aop:aspectj-autoproxy /><!-- 配置示例 --><aop:config><!-- 定义切面 --><aop:aspect id="mygreetingAspect" ref="greetingAspect"><!-- 加入相应的Aspect --><aop:pointcut id="greetingPointCut"expression="execution(* boa.framework.dao.*.add*(..))||execution(* boa.framework.dao.*.update*(..))||execution(* boa.framework.dao.*.delete*(..))" /><!-- 方法之前执行 --><aop:before method="sayHello" pointcut-ref="greetingPointCut" /><!-- 方法之后执行 --><aop:after method="after" pointcut-ref="greetingPointCut" /><aop:around method="around" pointcut-ref="greetingPointCut" /></aop:aspect></aop:config><bean id="exceptionLog" class="boa.framework.aspect.ExceptionLog"></bean> <!-- beanName自动代理 --><bean id="logAdvice"class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator"><property name="beanNames"><list><value>userDAO</value></list></property><property name="interceptorNames"><list><value>exceptionLog</value></list></property></bean></beans>
0 0
- Spring AOP 代理配置笔记
- Spring AOP配置 动态代理
- 学习笔记--代理与AOP及实现类似SPRING的可配置的AOP框架
- 循序渐进之Spring AOP(3) - 配置代理
- Spring学习笔记:使用代理实现AOP
- Spring-AOP配置(学习笔记)
- web学习笔记19-静态代理,动态代理,spring AOP
- Spring AOP 代理机制
- spring aop代理列子
- Spring Aop xml代理
- Spring AOP代理机制
- Spring Aop 动态代理
- Spring AOP 代理机制
- Spring AOP 代理机制
- Spring Aop代理
- Spring AOP代理模式
- Spring AOP动态代理
- Spring AOP 动态代理
- 撰写我的-----前端样式集
- Fragment和Activity之间的接口
- iBatis 控制台输出 sql
- WCF 应用
- OCP原则
- Spring AOP 代理配置笔记
- java的string中的trim方法实现
- 二叉搜索树的后序遍历
- java 浮点数值计算误差
- 使用LinQ实现对数据对象的查询
- 如何在spring中获取request对象
- poj 3255 Roadblocks【次短路】
- 12 个组织良好的网络监控工具
- java多线程实例