struts2+hibernate+spring配置版框架搭建以及简单测试(方便脑补)

Posted --->别先生<---

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了struts2+hibernate+spring配置版框架搭建以及简单测试(方便脑补)相关的知识,希望对你有一定的参考价值。

为了之后学习的日子里加深对框架的理解和使用,这里将搭建步奏简单写一下,目的主要是方便以后自己回来脑补;

1:File--->New--->Other--->Maven--->Maven Project--->Next(之后界面如下所示:)

--->Next(点击next之后出现如下界面:选择最后一个 maven-archetype-webapp,然后点击next)

--->Next(点击next之后出现如下界面,然后选择好组织号,工程号,版本号即可),最后点击Finish

2:maven项目创建好之后会报错,这里先在pom.xml中导入jar包,导入方式如下所示:这个pom配置好之后点击保存会将jar包下载到本地仓库,这个学习maven的时候都配置过,这个自己下去脑补吧;

  1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  3   <modelVersion>4.0.0</modelVersion>
  4   <groupId>com.bie.maven</groupId>
  5   <artifactId>ssh_xml</artifactId>
  6   <packaging>war</packaging>
  7   <version>0.0.1-SNAPSHOT</version>
  8   <name>ssh_xml Maven Webapp</name>
  9   <url>http://maven.apache.org</url>
 10   
 11   
 12   
 13   <!-- 配置一下jar包 -->
 14    <properties>
 15         <java-version>1.8</java-version>
 16         <junit-version>4.8.2</junit-version>
 17         <org.springframework-version>3.2.4.RELEASE</org.springframework-version>
 18         <jackson-mapper-asl-version>1.9.12</jackson-mapper-asl-version>
 19         <jackson-core-asl-version>1.9.12</jackson-core-asl-version>
 20         <mysql-connector-java-version>5.1.8</mysql-connector-java-version>
 21         
 22         <opensymphony-version>2.4.2</opensymphony-version>
 23         <freemarker-version>2.3.9</freemarker-version>
 24         <c3p0-version>0.9.1.2</c3p0-version>
 25         <commons-collections-version>1.0</commons-collections-version>
 26         <commons-fileupload-version>1.2.2</commons-fileupload-version>
 27         <org.apache.commons-version>3.1</org.apache.commons-version>
 28         <commons-codec-version>1.6</commons-codec-version>
 29         <dom4j-version>1.6.1</dom4j-version>
 30         <javax.servlet-version>1.2</javax.servlet-version>
 31         <aspectjweaver-version>1.6.6</aspectjweaver-version>
 32         <slf4j-log4j12-version>1.6.6</slf4j-log4j12-version>
 33         <log4j-version>1.2.16</log4j-version>
 34         <javax.servlet-jsp-version>2.0</javax.servlet-jsp-version>
 35         <cglib-version>2.2.2</cglib-version>
 36         <slf4j-api-version>1.6.6</slf4j-api-version>
 37         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 38     </properties>
 39     <dependencies>
 40         <!-- 配置 junit4.8.2 -->
 41         <dependency>
 42             <groupId>junit</groupId>
 43             <artifactId>junit</artifactId>
 44             <version>${junit-version}</version>
 45             <type>jar</type>
 46         </dependency>
 47         <!-- 配置 spring -->
 48         <dependency>
 49             <groupId>org.springframework</groupId>
 50             <artifactId>spring-core</artifactId>
 51             <version>${org.springframework-version}</version>
 52         </dependency>
 53         <dependency>
 54             <groupId>org.springframework</groupId>
 55             <artifactId>spring-web</artifactId>
 56             <version>${org.springframework-version}</version>
 57         </dependency>
 58         <dependency>
 59             <groupId>org.springframework</groupId>
 60             <artifactId>spring-test</artifactId>
 61             <version>${org.springframework-version}</version>
 62         </dependency>
 63         <dependency>
 64             <groupId>org.springframework</groupId>
 65             <artifactId>spring-aspects</artifactId>
 66             <version>${org.springframework-version}</version>
 67         </dependency>
 68         <dependency>
 69             <groupId>org.springframework</groupId>
 70             <artifactId>spring-context-support</artifactId>
 71             <version>${org.springframework-version}</version>
 72         </dependency>
 73         <dependency>
 74             <groupId>org.springframework</groupId>
 75             <artifactId>spring-web</artifactId>
 76             <version>${org.springframework-version}</version>
 77         </dependency>
 78 
 79         <dependency>
 80             <groupId>org.springframework</groupId>
 81             <artifactId>spring-webmvc</artifactId>
 82             <version>${org.springframework-version}</version>
 83         </dependency>
 84         <dependency>
 85             <groupId>org.springframework</groupId>
 86             <artifactId>spring-jdbc</artifactId>
 87             <version>${org.springframework-version}</version>
 88         </dependency>
 89         <dependency>
 90             <groupId>org.springframework</groupId>
 91             <artifactId>spring-tx</artifactId>
 92             <version>${org.springframework-version}</version>
 93         </dependency>
 94         <dependency>
 95             <groupId>org.springframework</groupId>
 96             <artifactId>spring-instrument</artifactId>
 97             <version>${org.springframework-version}</version>
 98         </dependency>
 99         <dependency>
100             <groupId>org.springframework</groupId>
101             <artifactId>spring-instrument-tomcat</artifactId>
102             <version>${org.springframework-version}</version>
103         </dependency>
104         
105         <dependency>  
106             <groupId>org.springframework</groupId>  
107             <artifactId>spring-orm</artifactId>  
108             <version>${org.springframework-version}</version>  
109         </dependency>
110         <!--springmvc 转换为 Json -->
111         <dependency>
112             <groupId>org.codehaus.jackson</groupId>
113             <artifactId>jackson-mapper-asl</artifactId>
114             <version>${jackson-mapper-asl-version}</version>
115         </dependency>
116         <dependency>
117             <groupId>org.codehaus.jackson</groupId>
118             <artifactId>jackson-core-asl</artifactId>
119             <version>${jackson-core-asl-version}</version>
120         </dependency>
121         <!--配置 freemarker -->
122         <dependency>
123             <groupId>freemarker</groupId>
124             <artifactId>freemarker</artifactId>
125             <version>${freemarker-version}</version>
126         </dependency>
127         
128         <!-- jdbc driver -->
129         <dependency>
130             <groupId>mysql</groupId>
131             <artifactId>mysql-connector-java</artifactId>
132             <version>${mysql-connector-java-version}</version>
133         </dependency>
134         <!-- connect pool with c3p0 -->
135         <dependency>
136             <groupId>c3p0</groupId>
137             <artifactId>c3p0</artifactId>
138             <version>${c3p0-version}</version>
139         </dependency>
140 
141         <dependency>
142             <groupId>commons-fileupload</groupId>
143             <artifactId>commons-fileupload</artifactId>
144             <version>${commons-fileupload-version}</version>
145         </dependency>
146 
147         <dependency>
148             <groupId>org.apache.commons</groupId>
149             <artifactId>commons-lang3</artifactId>
150             <version>${org.apache.commons-version}</version>
151         </dependency>
152 
153         <dependency>
154             <groupId>commons-codec</groupId>
155             <artifactId>commons-codec</artifactId>
156             <version>${commons-codec-version}</version>
157         </dependency>
158         <!-- analyze xml use dom4j -->
159         <dependency>
160             <groupId>dom4j</groupId>
161             <artifactId>dom4j</artifactId>
162             <version>${dom4j-version}</version>
163         </dependency>
164         <!-- about servlet -->
165         <dependency>
166             <groupId>javax.servlet</groupId>
167             <artifactId>jstl</artifactId>
168             <version>${javax.servlet-version}</version>
169         </dependency>
170 
171 
172         <dependency>
173             <groupId>taglibs</groupId>
174             <artifactId>standard</artifactId>
175             <version>1.1.2</version>
176         </dependency>
177         <dependency>
178             <groupId>javax.servlet</groupId>
179             <artifactId>javax.servlet-api</artifactId>
180             <version>3.0.1</version>
181             <scope>provided</scope>
182         </dependency>
183         <dependency>
184             <groupId>org.slf4j</groupId>
185             <artifactId>slf4j-log4j12</artifactId>
186             <version>1.6.6</version>
187             <scope>provided</scope>
188         </dependency>
189         <dependency>
190             <groupId>log4j</groupId>
191             <artifactId>log4j</artifactId>
192             <version>1.2.17</version>
193         </dependency>
194 
195         <dependency>
196             <groupId>org.slf4j</groupId>
197             <artifactId>slf4j-api</artifactId>
198             <version>1.6.6</version>
199         </dependency>
200         <dependency>
201             <groupId>javax.activation</groupId>
202             <artifactId>activation</artifactId>
203             <version>1.1.1Struts2+Spring+Hibernate(SSH)框架的搭建

struts2集成Spring,Hibernate的问题!!

Spring:Spring整合Hibernate,之后整合Struts2

Maven搭建Struts2+Spring3+Hibernate4框架

Spring4 整合Hibernate4,Struts2

Spring+struts2+Hibernate框架的搭建