ssh(struts,spring,hibernate)开发的初步集成01--依赖

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ssh(struts,spring,hibernate)开发的初步集成01--依赖相关的知识,希望对你有一定的参考价值。

 一.概念

  SSH 通常指的是 Struts2 做前端控制器,spring 管理各层的组件,hibernate 负责持久化层。

  SSM 则指的是 SpringMVC 做前端控制器,Spring 管理各层的组件,MyBatis 负责持久化层。

 二.构建流程

  创建maven工程...在pom.xml文件中配置需要的依赖

<properties>
<java-version>1.8</java-version>
<junit-version>4.8.2</junit-version>
<org.springframework-version>3.2.4.RELEASE</org.springframework-version>
<jackson-mapper-asl-version>1.9.12</jackson-mapper-asl-version>
<jackson-core-asl-version>1.9.12</jackson-core-asl-version>
<mysql-connector-java-version>5.1.8</mysql-connector-java-version>
<org.mybatis-version>3.2.7</org.mybatis-version>
<org.mybatis-spring-version>1.2.2</org.mybatis-spring-version>
<opensymphony-version>2.4.2</opensymphony-version>
<freemarker-version>2.3.9</freemarker-version>
<c3p0-version>0.9.1.2</c3p0-version>
<commons-collections-version>1.0</commons-collections-version>
<commons-fileupload-version>1.2.2</commons-fileupload-version>
<org.apache.commons-version>3.1</org.apache.commons-version>
<commons-codec-version>1.6</commons-codec-version>
<dom4j-version>1.6.1</dom4j-version>
<javax.servlet-version>1.2</javax.servlet-version>
<aspectjweaver-version>1.6.6</aspectjweaver-version>
<slf4j-log4j12-version>1.6.6</slf4j-log4j12-version>
<log4j-version>1.2.16</log4j-version>
<javax.servlet-jsp-version>2.0</javax.servlet-jsp-version>
<cglib-version>2.2.2</cglib-version>
<slf4j-api-version>1.6.6</slf4j-api-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

  

<dependencies>
<!-- with junit4.8.2 -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit-version}</version>
<type>jar</type>
</dependency>


<!-- with spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${org.springframework-version}</version>
</dependency>


<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${org.springframework-version}</version>
</dependency>


<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework-version}</version>
</dependency>


<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${org.springframework-version}</version>
</dependency>


<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${org.springframework-version}</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>


<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>


<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${org.springframework-version}</version>
</dependency>


<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-instrument</artifactId>
<version>${org.springframework-version}</version>
</dependency>


<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-instrument-tomcat</artifactId>
<version>${org.springframework-version}</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${org.springframework-version}</version>
</dependency>


<!--springmvc 杞?Json -->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>${jackson-mapper-asl-version}</version>
</dependency>


<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>${jackson-core-asl-version}</version>
</dependency>


<!--freemarker -->
<dependency>
<groupId>freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>${freemarker-version}</version>
</dependency>


<!-- with mybatis-spring -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>${org.mybatis-version}</version>
</dependency>


<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>${org.mybatis-spring-version}</version>
</dependency>


<!-- jdbc driver -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql-connector-java-version}</version>
</dependency>


<!-- connect pool with c3p0 -->
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>${c3p0-version}</version>
</dependency>


<!-- apache commons jar -->
<!-- <dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>${commons-collections-version}</version>
<scope>provided</scope>
</dependency> -->

<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${commons-fileupload-version}</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${org.apache.commons-version}</version>
</dependency>

<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>${commons-codec-version}</version>
</dependency>


<!-- analyze xml use dom4j -->
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>${dom4j-version}</version>
</dependency>


<!-- about servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>${javax.servlet-version}</version>
</dependency>


<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>


<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>


<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.6</version>
<scope>provided</scope>
</dependency>


<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.6</version>
</dependency>


<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>

<!-- memcached -->
<dependency>
<groupId>com.google.code.maven-play-plugin.spy</groupId>
<artifactId>memcached</artifactId>
<version>2.4.2</version>
</dependency>


<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>${cglib-version}</version>
</dependency>


<dependency>
<groupId>net.fckeditor</groupId>
<artifactId>java-core</artifactId>
<version>2.6</version>
</dependency>


<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20131018</version>
</dependency>


<!-- excel鎿嶄綔 -->
<!-- <dependency> <groupId>cn.liu.jxl</groupId> <artifactId>jxl</artifactId>
<version>2.6.10</version> </dependency> -->

<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.18.1</version>
</dependency>


<dependency>
<groupId>jsptags</groupId>
<artifactId>pager-taglib</artifactId>
<version>2.0</version>
</dependency>

<dependency>
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>2.6.10</version>
</dependency>

<dependency>
<groupId>opensymphony</groupId>
<artifactId>oscache</artifactId>
<version>2.4.1</version>
</dependency>


<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.3.8</version>
<exclusions>


<exclusion>
<artifactId>javassist</artifactId>
<groupId>javassist</groupId>
</exclusion>


</exclusions>
</dependency>

<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>2.3.8</version>
</dependency>

<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-convention-plugin</artifactId>
<version>2.3.8</version>
</dependency>


<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.1.7.Final</version>
</dependency>


<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
<version>4.1.7.Final</version>
</dependency>

<dependency>
<groupId>displaytag</groupId>
<artifactId>displaytag</artifactId>
<version>1.2</version>
</dependency>

</dependencies>

<build>
<finalName>ssh</finalName>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>http://localhost:8080/manager/text</url>
<!-- <path>/</path> -->
<username>admin</username>
<password>123</password>
</configuration>
</plugin>
</plugins>
</build>
</project>

 

以上皆为ssh项目的依赖..大家也可以根据自己的需求添加

 














































































































































































































































































































以上是关于ssh(struts,spring,hibernate)开发的初步集成01--依赖的主要内容,如果未能解决你的问题,请参考以下文章

Struts2+Hibernate框架探险

SSH框架搭建 Spring + Struts + Hibernate

SSH之Spring整合struts2

SSH(Struts+spring+hibernate)配置

spring+struts2+hibernate整合(ssh)

SSH(struts2+spring+hibernate)三大框架整合