Struts2+Spring2.5+Hibernate3.3整合开发

一、整合开发时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>

相关推荐