Spring4复习之Spring4 整合 Hibernate4、Struts2(Maven版)

目录结构:

pom.xml

<?xml version="1.0" encoding="UTF-8"?>



<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>



  <groupId>cn.java68</groupId>

  <artifactId>Demo_S2S4H4</artifactId>

  <version>1.0-SNAPSHOT</version>

  <packaging>war</packaging>



  <name>Demo_S2S4H4 Maven Webapp</name>

  <!-- FIXME change it to the project's website -->

  <url>http://www.example.com</url>



  <properties>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <maven.compiler.source>1.7</maven.compiler.source>

    <maven.compiler.target>1.7</maven.compiler.target>

  </properties>



  <dependencies>

    <dependency>

      <groupId>junit</groupId>

      <artifactId>junit</artifactId>

      <version>4.11</version>

      <scope>test</scope>

    </dependency>

    <!--Struts2依赖-->

    <dependency>

      <groupId>org.apache.struts</groupId>

      <artifactId>struts2-core</artifactId>

      <version>2.3.16.3</version>

    </dependency>

    <dependency>

      <groupId>antlr</groupId>

      <artifactId>antlr</artifactId>

      <version>2.7.7</version>

    </dependency>

    <dependency>

      <groupId>net.sf.ezmorph</groupId>

      <artifactId>ezmorph</artifactId>

      <version>1.0.6</version>

    </dependency>

    <dependency>

      <groupId>org.apache.struts</groupId>

      <artifactId>struts2-spring-plugin</artifactId>

      <version>2.3.16.3</version>

    </dependency>



    <!--Spring依赖-->

    <dependency>

      <groupId>org.springframework</groupId>

      <artifactId>spring-context</artifactId>

      <version>4.0.6.RELEASE</version>

    </dependency>

    <dependency>

      <groupId>org.springframework</groupId>

      <artifactId>spring-core</artifactId>

      <version>4.0.6.RELEASE</version>

    </dependency>

    <dependency>

      <groupId>org.springframework</groupId>

      <artifactId>spring-beans</artifactId>

      <version>4.0.6.RELEASE</version>

    </dependency>



    <dependency>

      <groupId>org.springframework</groupId>

      <artifactId>spring-tx</artifactId>

      <version>4.0.6.RELEASE</version>

    </dependency>

    <dependency>

      <groupId>org.springframework</groupId>

      <artifactId>spring-web</artifactId>

      <version>4.0.6.RELEASE</version>

    </dependency>

    <dependency>

      <groupId>org.springframework</groupId>

      <artifactId>spring-webmvc</artifactId>

      <version>4.0.6.RELEASE</version>

    </dependency>

    <dependency>

      <groupId>org.springframework</groupId>

      <artifactId>spring-jdbc</artifactId>

      <version>4.0.6.RELEASE</version>

    </dependency>

    <dependency>

      <groupId>org.springframework</groupId>

      <artifactId>spring-context-support</artifactId>

      <version>4.0.6.RELEASE</version>

    </dependency>

    <dependency>

      <groupId>org.aspectj</groupId>

      <artifactId>aspectjweaver</artifactId>

      <version>1.8.10</version>

    </dependency>

    <dependency>

      <groupId>org.springframework</groupId>

      <artifactId>spring-orm</artifactId>

      <version>4.0.6.RELEASE</version>

    </dependency>





    <!-- Hibernate依赖 -->

    <dependency>

      <groupId>org.hibernate</groupId>

      <artifactId>hibernate-core</artifactId>

      <version>4.3.5.Final</version>

    </dependency>

    <dependency>

      <groupId>net.sf.ehcache</groupId>

      <artifactId>ehcache-core</artifactId>

      <version>2.4.3</version>

    </dependency>

    <dependency>

      <groupId>org.hibernate</groupId>

      <artifactId>hibernate-c3p0</artifactId>

      <version>4.3.5.Final</version>

    </dependency>



    <!-- mysql驱动依赖 -->

    <dependency>

      <groupId>mysql</groupId>

      <artifactId>mysql-connector-java</artifactId>

      <version>5.1.35</version>

    </dependency>



    <!--<dependency>-->

      <!--<groupId>javax.servlet.jsp</groupId>-->

      <!--<artifactId>javax.servlet.jsp-api</artifactId>-->

      <!--<version>2.2.1</version>-->

      <!--<scope>provided</scope>-->

    <!--</dependency>-->

    <!--<dependency>-->

      <!--<groupId>javax.servlet</groupId>-->

      <!--<artifactId>javax.servlet-api</artifactId>-->

      <!--<version>3.1.0</version>-->

      <!--<scope>provided</scope>-->

    <!--</dependency>-->



  </dependencies>



  <build>

    <finalName>Demo_S2S4H4</finalName>

    <pluginManagement>

      <plugins>

        <plugin>

          <artifactId>maven-clean-plugin</artifactId>

          <version>3.0.0</version>

        </plugin>

        <plugin>

          <artifactId>maven-resources-plugin</artifactId>

          <version>3.0.2</version>

        </plugin>

        <plugin>

          <artifactId>maven-compiler-plugin</artifactId>

          <version>3.7.0</version>

        </plugin>

        <plugin>

          <artifactId>maven-surefire-plugin</artifactId>

          <version>2.20.1</version>

        </plugin>

        <plugin>

          <artifactId>maven-war-plugin</artifactId>

          <version>3.2.0</version>

        </plugin>

        <plugin>

          <artifactId>maven-install-plugin</artifactId>

          <version>2.5.2</version>

        </plugin>

        <plugin>

          <artifactId>maven-deploy-plugin</artifactId>

          <version>2.8.2</version>

        </plugin>

      </plugins>

    </pluginManagement>

  </build>

</project>

UserAction.java

BaseDaOImpl.java

BaseDao.java

User.java

UserServiceImpl.java

UserService.java

applicationContext.xml

hibernate.cfg.xml

struts.xml

web.xml

index.jsp

 

要用到的工具,视频教程,关注公众号(Java学习之乐)直接免费获取:

猜你喜欢

转载自blog.csdn.net/wtyicy/article/details/81364860