When building an SSH framework, we need to introduce some jar packages.
First, let's take a look at the SSH versions we use and the imported jar packages.
Struts2.3.1.2:
Struts2-core-2.3.1.jar
Javassist-3.11.0.GA.jar
Commons-io-2.0.1.jar
Commons-lang-2.5.jar
Commons-fileupload-1.2.2.jar
Xwork-core-2.3.1.2.jar
Freemarker-2.3.18.jar
Ognl-3.0.4.jar
Struts2-spring-plugin-2.3.1.2.jar
Spring2.5.6
Spring. Jar
Commons-logging-1.1.1.jar
Common-annotations.jar
Aspectjrt. Jar
Aspectjweaver. Jar
Cglib-nodep-2.1_3.jar
If you use basicdatasource to configure the database connection, you need to add two packages:
Commons-pool.jar
Commons-dbcp.jar
Hibernate3.6.8
Hibernate3.jar
Hibernate-jpa-2.0-api-1.0.1.jar
Antlr-2.7.6.jar
Commons-collection-3.1.jar
Dom4j-1.6.1.jar
Javassist-3.12.0.GA.jar
Jta-1.1.jar
Slf4j-api-1.6.1.jar
Slf4j-nop-1.6.4.jar
After presenting this bunch of unfamiliar and familiar jar packages, I will explain them one by one:
1) jar package in struts
Jar package name |
Function |
Struts2-core-2.x.x.jar |
Struts2 core jar package |
Javassist-3.x.x.GA.jar |
An open-source class library for analyzing, editing, and creating Java bytecode (this is also required in hibernate. Just introduce one of them) |
Commons-io-2.x.x.jar |
Commons project (Commons project is a common public component in Java) Io sub-project, is to handle exceptions |
Commons-lang-2.x.jar |
Lang Package in Commons project |
Commons-fileupload-1.x.x.jar |
The file upload package in the Commons project must be added to the file after version struts2.1.6. |
Xwork-core-2.x.x.jar |
The core jar package of xwork, because struts2 is an upgraded version of webwork, it must be dependent on it (struts2 is built on it) |
Freemarker-2.x.x.jar |
Support freemarker (struts2 UI tag template written by freemarker), which is also available in webwork |
Ognl-3.x.x.jar |
Supports the ognl language (object graph Navigation language). The struts2 framework reads and writes object attributes through it, and webwork also supports the ognl Language |
Struts2-spring-plugin-2.x.x.jar |
Used when struts2 is integrated with spring. After the jar package is introduced, you must specify the struts objectfactory (which can be struts or spring) in struts. xml. Otherwise, the program reports an error. |
The version of each jar package is not determined based on struts, but updated based on the version of the corresponding source. Therefore, you can see that the versions of each jar package in a struts version are different. (The same is true for spring and hibernate)
2) jar package in spring
Jar package name |
Function |
Spring. Jar |
Spring core jar package |
Commons-logging-1.x.x.jar |
The log package produced by ASF, which is used by the struts2, spring, and hibernate frameworks to support logging of log4j and JDK 1.4 + |
Common-annotations.jar |
Annotation-supported packages |
Aspectjrt. Jar Aspectjweaver. Jar |
Support for AOP packages |
Cglib-nodep-2.x_x.jar |
Packages supporting cglib dynamic proxy |
Commons-pool.jar Commons-dbcp.jar |
Supports basicdatasource to configure database connections (if you do not need basicdatasource to configure a database, you do not need to introduce it) |
3) jar package in hibernate
Jar package name |
Function |
Hibernate3.jar |
Hibernate core jar package |
Hibernate-jpa-2.x-api-x.x.x.jar |
Support for JPA (Java persistence API) Specifications |
Antlr-2.x.x.jar |
Language conversion tool, which hibernate uses to convert hql to SQL |
Commons-collection-3.x.jar |
Subprojects in the Commons project encapsulate collection sets. |
Dom4j-1.x.x.jar |
The encapsulation of dom4j is used to parse XML files. |
Javassist-3.x.x.GA.jar |
An open-source class library for analyzing, editing, and creating Java bytecode |
Jta-x.x.jar |
Hibernate's Transaction Processing |
Slf4j-api-x.x.x.jar |
Slf4j is a simple facade for log systems. It allows end users to use the desired log system when deploying their applications. |
Slf4j-nop-x.x.x.jar |
An Implementation of the slf4j-api-x.x.x.jar, this jar package To Go To The slf4j official website to download the slf4j-1.6.4 integration package |
Explanation of the jar package in SSH