【发布时间】:2012-10-23 17:10:37
【问题描述】:
我的单元测试中有一个方面正常工作,从实际方法打印一条日志消息,然后从应用的方面打印。
但在运行我的 webapp 时,我只看到应用了 '@afterReturning' 建议的结果,我的方法没有首先执行。
我的配置:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
<aop:aspectj-autoproxy proxy-target-class="true" />
<bean id="loggingAspect" class="com.mypackage.MyAspect" />
</beans>
有什么想法吗?
感谢您的帮助。
【问题讨论】: