使用IDEA进行struts2+Spring+mybatis+maven框架整合(三)spring框架搭建

本文主要介绍了如何在IntelliJ IDEA中进行Struts2、Spring、Mybatis及Maven框架的整合,重点讲解了Spring框架的搭建过程,包括在pom.xml中添加Spring依赖以及配置druid数据库连接池。
摘要由CSDN通过智能技术生成

1、pom.xml文件中导入Spring依赖的jar包:

<!--spring依赖的jar包-->
    <!--Core模块主要的功能是实现了控制反转与依赖注入、Bean配置以及加载。Core模块中有Beans、BeanFactory、BeanDefinitions、ApplicationContext等概念-->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
      <version>5.0.3.RELEASE</version>
    </dependency>
    <!--这个jar文件是所有应用都要用到的,它包含访问配置文件、创建和管理bean以及进行Inversion of Control / Dependency Injection(IoC/DI)操作相关的所有类。如果应用只需基本的IoC/DI支持,引入spring-core.jar及spring-beans.jar文件就可以了。-->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
      <version>5.0.3.RELEASE</version>
    </dependency>
    <!--提供对AspectJ的支持,以便可以方便的将面向切面的功能集成进IDE中,比如Eclipse AJDT。外部依赖。-->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-aspects</artifactId>
      <version>5.0.3.RELEASE</version>
    </dependency>
    <!--这个jar文件为Spring核心提供了大量扩展。可以找到使用Spring ApplicationContext特性时所需的全部类,JDNI所需的全部类,UI方面的用来与模板(Templating)引擎如Velocity、FreeMarker、JasperReports集成的类,以及校验Validation方面的相关类。-->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <version>5.0.3.RELEASE</version>
    </dependency>
    <!--这个jar 文件包含对Spring 对JDBC 数据访问进行封装的所有类。外部依赖spring-beans,spring-dao。-->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jdbc</artifactId>
      <version>5.0.3.RELEASE</version>
    </dependency>
    <!--这个jar 文件包含Web 应用开发时,用到Spring 框架时所需的核心类,包括自动载入Web ApplicationContext 特性的类、Struts 与JSF 集成类、文件上传的支持类、Filter 类和大量工具辅助类。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值