0
点赞
收藏
分享

微信扫一扫

基于Spring环境的AspectJ开发环境搭建

基于Spring环境的AspectJ开发环境搭建

AspectJ是专门针对AOP问题的,所以其运行是需要AOP环境的,即需要之前的AOP的两个Jar包。另外,还需要AspectJ自身的Jar包

一、导入jar包

所需jar已经保存在百度云盘上了:​​http://pan.baidu.com/s/1jISd9vK​​

二、引入AOP约束

在配置文件头部,要引入关于aop的约束。在Spring框架的解压目录中,\docs\spring-framework-reference\html下的xsd-configuration.html文件中

基于Spring环境的AspectJ开发环境搭建_jar包


约束如下

<?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.xsd"> <!-- bean definitions here -->

</beans>

在前面Spring实现AOP时,并未引入AOP的约束,而在AspectJ实现AOP时,才提出要引入AOP的约束。说明,配置文件中使用的AOP约束中的标签,均是AspectJ框架使用的,而非Spring框架本身在实现AOP时使用的


举报

相关推荐

0 条评论