MyEclipse — Maven+Spring+Struts+Hibernate 整合 [学习笔记-2]

引入Spring

修改 pox.xml 文件 添加jar包引用

<!-- spring3 -->
      <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-core</artifactId>
          <version>4.1.5.RELEASE</version>
      </dependency>
      <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-context</artifactId>
          <version>4.1.5.RELEASE</version>
      </dependency>
      <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-jdbc</artifactId>
          <version>4.1.5.RELEASE</version>
      </dependency>
      <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-beans</artifactId>
          <version>4.1.5.RELEASE</version>
      </dependency>
      <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-web</artifactId>
          <version>4.1.5.RELEASE</version>
      </dependency>
      <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-expression</artifactId>
          <version>4.1.5.RELEASE</version>
      </dependency>
      <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-orm</artifactId>
          <version>4.1.5.RELEASE</version>
      </dependency>
View Code

完成对Spring jar包的引用

resource文件下加入spring.xml

 

 

spring.xml 中加入[不用在写Bean]

在相对org.service包中的类名上加上注解

 

在Web.xml中加入Spring配置

============Spring加入完毕======================

 

项目编码UTF-8

posted @ 2015-05-27 15:24  遥远的守望  阅读(153)  评论(0编辑  收藏  举报