为什么我的输出结果没有MoocAspect before,只有AspectBiz呢?怎么觉得是配置文件没有生效??
配置文件如下:
<?xml version="1.0" encoding="UTF-8"?>
<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.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.0.xsd">
<bean id="moocAspect" class="com.imooc.aop.schema.advice.MoocAspect"></bean>
<bean id="aspectBiz" class="com.imooc.aop.schema.advice.AspectBiz"></bean>
<aop:config>
<aop:aspect id="moocAspectAOP" ref="moocAspect">
<aop:pointcut expression="execution(* com.imooc.aop.schema.advice.biz.*Biz.*(..))" id="moocPoint"/>
<aop:before method="before" pointcut-ref="moocPoint"/>
</aop:aspect>
</aop:config>
</beans>
输出结果:
三月 06, 2016 8:42:08 下午 org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@5bc22f22: startup date [Sun Mar 06 20:42:08 CST 2016]; root of context hierarchy
三月 06, 2016 8:42:08 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from URL [file:/D:/Program%20Files%20(x86)/eclipse-jee-luna-SR2-win32-x86_64/eclipse/D/workspace/spring/bin/spring-aop-schema-aspect.xml]
AspectBiz
三月 06, 2016 8:42:08 下午 org.springframework.context.support.AbstractApplicationContext doClose
INFO: Closing org.springframework.context.support.ClassPathXmlApplicationContext@5bc22f22: startup date [Sun Mar 06 20:42:08 CST 2016]; root of context hierarchy