`
1028826685
  • 浏览: 920662 次
  • 性别: Icon_minigender_1
  • 来自: 重庆
社区版块
存档分类

使用Spring进行面向切面(AOP)编程

阅读更多
基础知识:

要进行AOP编程,首先我们要在spring的配置文件中引入aop命名空间:
<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-2.5.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
</beans>

Spring提供了两种切面声明方式,实际工作中我们可以选用其中一种:
基于XML配置方式声明切面。
基于注解方式声明切面。


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics