首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 开源软件 >

Aop署理before和after

2012-06-26 
Aop代理before和afterbean idfooService /bean idaopInject idallExecution/aop:before met

Aop代理before和after

<bean id="fooService" /><bean id="aopInject" id="allExecution"/>    <aop:before method="injectMethod" pointcut-ref="allExecution"/>  </aop:aspect></aop:config>


AopInject类, 代理类:
public class AopInject {  public void injectMethod() throws Throwable {    System.out.println("AopInject类注入");  }}


注意事项PS:
用before和after, 代理类不支持方法参数ProceedingJoinPoint,所以必须去掉该参数

热点排行