我已将该行添加<context:load-time-weaver/>
到我的 application-context.xml,
并创建了一个META-INF\aop.xml
包含以下内容的文件:
<!DOCTYPE aspectj PUBLIC "-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd">
<aspectj>
<weaver options="-verbose">
<!-- only weave classes in our application-specific packages -->
<include within="com.xxx.aspectj.*"/>
</weaver>
<aspects>
<aspect name="com.xxx.aspectj.StandardAspect"/>
</aspects>
</aspectj>
包括一个包罗万象的方面,以简单地查看它是否有效:
@After("call (public * *(..))")
public void interceptEverything() {
System.out.println("Hello");
}
但似乎什么也没发生,有什么想法吗?