MyEclipse — Maven+Spring+Struts+Hibernate 整合 [學習筆記-2]

引入Springweb

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

<!-- 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包的引用express

resource文件下加入spring.xmlide

 

 

spring.xml 中加入[不用在寫Bean]編碼

在相對org.service包中的類名上加上註解spa

 

在Web.xml中加入Spring配置code

============Spring加入完畢======================orm

 

項目編碼UTF-8xml

相關文章
相關標籤/搜索