一、整合开发时
Struts 2
、
Hibernate
、
Spring
需要的
JAR
。
struts2-core-2.x.x.jar :
Struts 2
框架的核心类库
Xwork-core-2.x.x.jar :
XWork
类库,
Struts 2
在其上构建
ognl-2.6.x.jar :
对象图导航语言(
Object Graph Navigation Language
),
struts2
框架通过其读写对象的属性
freemarker-2.3.x.jar :
Struts 2
的
UI
标签的模板使用
FreeMarker
编写
commons-fileupload-1.2.x.jar
文件上传组件,
2.1.6
版本后需要加入此文件
struts2-spring-plugin-2.x.x.jar
:
用于
struts2
集成
Spring
的插件
hibernate
核心安装包下的
(
下载路径:
http://www.hibernate.org/
,
点击
“
Hibernate Core”
右边的
“
Downloads”):
hibernate3.jar
lib\bytecode\cglib\hibernate-cglib-repack-2.1_3.jar
lib\required\*.jar
hibernate
注解安装包下的
(
下载路径:
www.hibernate.org
,
点击
“
Hibernate Annotations”
右边的
“
Downloads”):
hibernate-annotations.jar
lib\ejb3-persistence.jar
、
hibernate-commons-annotations.jar
Hibernate
针对
JPA
的实现包
(
下载路径:
www.hibernate.org
,
点击
“
Hibernate Entitymanager”
右边的
“
Downloads”):
hibernate-entitymanager.jar
lib\test\log4j.jar
、
slf4j-log4j12.jar
Spring
安装包下的
dist\spring.jar
lib\c3p0\c3p0-0.9.1.2.jar lib\aspectj\aspectjweaver.jar
、
aspectjrt.jar lib\cglib\cglib-nodep-2.1_3.jar
lib\j2ee\common-annotations.jar lib\log4j\log4j-1.2.15.jar lib\jakarta-commons\commons-logging.jar
MYSQL
数据库驱动
jar
二、
Spring
的配置模版:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-
2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-
2.5.xsd">
</beans>