zoukankan      html  css  js  c++  java
  • Spring框架中的aop操作之一 及aspectjweaver.jar与aopalliance-1.0.jar下载地址 包含beans 注解context 和aop的约束

    (aspect oriented programming面向切面编程)

    首先在原有的jar包:

    需Spring压缩包中的四个核心JAR包

    beans 、context、core 和expression

    下载地址:

    https://pan.baidu.com/s/1qXLHzAW

    以及日志jar包

    commons-logging 和log4j

    下载地址:

    https://pan.baidu.com/s/1mimTW5i

    再增加一个

    spring-aop-5.0.1.RELEASE.jar (用于注解,在Spring-framework库中包含)

    再增加

    spring-aspects-5.0.1.RELEASE.jar (在Spring-framework库中包含)

    aspectjweaver-1.8.12.jar (官方下载地址 http://mvnrepository.com/artifact/org.aspectj/aspectjweaver)

    spring收购的aspectj的一部分包只关于weaver的

    aopalliance-1.0.jar            (官方下载地址 http://mvnrepository.com/artifact/aopalliance/aopalliance/1.0)

    上边是aop联盟的包


    然后在Spring-framework库中docs文件夹中找到html文件夹的xsd-configuration.html文件

    找到aop的相关约束。(不包含注解的约束)

    <?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>

    之前的注解context的约束(包括了下边的beans的约束)

    <?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:context="http://www.springframework.org/schema/context" xsi:schemaLocation="
            http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> <!-- bean definitions here -->
    
    </beans>

    之前的beans的约束

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="
            http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
    
        <bean id="foo" class="x.y.Foo">
            <property name="name" value="Rick"/>
        </bean>
    
    </beans>

    包含beans 注解context 和aop的约束

    <?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:context="http://www.springframework.org/schema/context"
        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/context http://www.springframework.org/schema/context/spring-context.xsd
             http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">
        <!-- 开启注解扫描 -->
        <context:component-scan base-package="com.swift"></context:component-scan>
    </beans>
  • 相关阅读:
    OpenMP笔记(一)
    Ubuntu16.04编译OpenCV3.4.7
    Ubuntu16.04编译tensorflow的C++接口
    win10编译tensorflow C++接口
    Qt5学习笔记(1)-环境配置(win+64bit+VS2013)
    Qt creator中配置opencv win7 64bit
    MYSQL其他常用函数
    MySQL 8.0中的新增功能
    MySQL中的JSON函数(三)修改JSON的函数
    MySQL中的JSON函数(二)查询JSON函数
  • 原文地址:https://www.cnblogs.com/qingyundian/p/7868001.html
Copyright © 2011-2022 走看看