Spring的安装
Spring框架包
spring-framework-4.3.6RELEASE-dist.ziphttp://repo.spring.io/simple/libs-release-local/org/springframework/spring/4.3.6RELEASE/我们初学者需要
- spring-core-4.3.6RELEASE.jar (核心工具类)
- spring-beans-4.3.6RELEASE.jar (访问配置文件、创建管理Bean)
- spring-context-4.3.6RELEASE.jar (提供拓展服务 邮件、任务调度、JNDI定位、EJB集成、远程访问等)
- spring-expression-4.3.6RELEASE.jar (定义了Spring表达式语言)
- commons-logging-1.2.jar (第三方依赖包http://commons.apache.org/proper/commons-logging/download_logging.cgi)
1.引入依赖
pom.xml
<dependency><groupId>org.springframework</groupId><artifactId>spring-core</artifactId><version>4.3.6.RELEASE</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-beans</artifactId><version>4.3.6.RELEASE</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-context</artifactId><version>4.3.6.RELEASE</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-expression</artifactId><version>4.3.6.RELEASE</version></dependency>
或者 下面一条
<dependency><groupId>org.springframework</groupId><artifactId>spring-webmvc</artifactId><version>4.3.6.RELEASE</version></dependency>
ad0
2.建立配置文件
Spring配置文件相当于在 WEB-INF/classes目录下(和类文件同级)文件名通常为 applicationContext.xml 或者 beans.xml