aop中配置了两个切面,指向同一个切点,但是只有order=1的执行了,不能两个都执行吗?
<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">
<aop:aspectj-autoproxy />
<bean id="TestAspect" class="com.example.demo.aspect.TestHandler"></bean>
<bean id="TestAspect2" class="com.example.demo.aspect.TestHandler2"></bean>
<aop:config>
<aop:aspect id="testAccess" ref="TestAspect" order="2">
<aop:around method="handleRestMethod1"
pointcut="(execution(* com.example.demo.controller..*.*(..))) and
(@annotation(restMethod))"/>
</aop:aspect>
<aop:aspect id="testAccess2" ref="TestAspect2" order="1">
<aop:around method="handleRestMethod2"
pointcut="(execution(* com.example.demo.controller..*.*(..))) and
(@annotation(restMethod))"/>
</aop:aspect>
</aop:config>
</beans>