读书人

Aop署理before和after

发布时间: 2012-06-26 10:04:13 作者: rapoo

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,所以必须去掉该参数

读书人网 >开源软件

热点推荐