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