Spring框架所需导入jar包总览(部分)

本文详细介绍了Spring框架的核心组件,包括IOC、基于注解的bean装配、JDK及CGLIB字节码增强和AOP编程。阐述了各组件所需JAR包及XML配置示例,帮助开发者快速上手Spring框架。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

一、IOC
4核心+1依赖
4核心:(路径:spring-framework-4.2.4.RELEASE\libs
spring-beans-4.2.4.RELEASE.jar,spring-context-4.2.4.RELEASE.jar
spring-core-4.2.4.RELEASE.jar,spring-expression-4.2.4.RELEASE.jar

1依赖:(spring-framework-3.0.2.RELEASE-dependencies\org.apache.commons\
com.springsource.org.apache.commons.logging\1.1.1
com.springsource.org.apache.commons.logging-1.1.1.jar


 

二、Spring,bean装配基于注解
1、需要spring-context-4.2.4.RELEASE.jar,spring-aop-4.2.4.RELEASE.jar的jar包
2、以下代码内容在 路径:spring-framework-4.2.4.RELEASE\docs\spring-framework-reference\html下的最后一个html中40.2.8 the context schema的标题下,需要把红色部分复制到xml配置文件中

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

(    这里我用的是spring4的jar,所以在编写注解的时候需要导入aop的jar包,我之前测试了很久都没有测试出来,总是xml报            错,在我导入了spring-aop-4.2.4.RELEASE.jar之后就可以正常运行了。如果是spring3不需要导入了)


三、Spring jdk,cglib字节码增强
需要导入jar包spring-core-4.2.4.RELEASE.jar


四、Spring aop编程
1、需要导入spring-aop-4.2.4.RELEASE.jar
和一个依赖com.springsource.org.aspectj.weaver-1.6.8.RELEASE.jar
(依赖路径为:spring-framework-3.0.2.RELEASE-dependencies\org.aspectj\
com.springsource.org.aspectj.weaver\1.6.8.RELEASE)
2、需要将以下的代码中红色的复制到xml配置文件中

<?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>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值