applicationContext-aop.xml 1.2 KB

1234567891011121314151617181920212223242526
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:context="http://www.springframework.org/schema/context"
  4. xmlns:aop="http://www.springframework.org/schema/aop"
  5. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  6. xsi:schemaLocation="http://www.springframework.org/schema/beans
  7. http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
  8. http://www.springframework.org/schema/context
  9. http://www.springframework.org/schema/context/spring-context-4.0.xsd
  10. http://www.springframework.org/schema/aop
  11. http://www.springframework.org/schema/aop/spring-aop-4.0.xsd">
  12. <!-- 异常捕获AOP -->
  13. <bean id="exceptionAspect" class="com.edu.service.aspect.ExceptionAspect">
  14. <property name="systemCode" value="101" />
  15. </bean>
  16. <aop:config>
  17. <!-- 对运行时异常的集中处理 -->
  18. <aop:aspect id="exceptionAop" ref="exceptionAspect" order="0">
  19. <aop:pointcut id="exceptionPointCut"
  20. expression="execution(* com.edu.service.*.*.*(..))"/>
  21. <aop:around pointcut-ref="exceptionPointCut" method="deal"/>
  22. </aop:aspect>
  23. </aop:config>
  24. </beans>