SSH框架搭建_Spring2+Struts2+hibernate3

SSH 框架搭建 及问题解决
Struts2.   spring 2  hibernate 3.2
1 创建Web工程
  2 添加 Spring 支持
2.1 [MyEclipse] > [Project Capabilities] > [Add Spring Capabilities]
2.2 选择 Spring 2.5 勾选包
Spring 2.5 AOP Libraries
Spring 2.5 Core Libraries
Spring 2.5 Persistence Core Libraries
Spring 2.5Persistence Core JDBC Libraries
2.3 勾选 [Enable AOP Builder]
勾选 [Specify new or existing Spring bean configuration file]
[finish]
3 添加 Hibernate 支持
3.1  [MyEclipse] > [Project Capabilities] >
[Add Hibernate Capabilities]
3.2 选择 Hibernate 3.3 勾选包
Hibernate 3.3 Annotations & Entity Manager
Hibernate 3.3 Core Libraries
选择 [Add checked Libraries to project folder and add to
build-path]
[Next] > 
选择 Hibernate configuration file
[Next] > 
选择 New Hibernate configuration file
勾选 Create Spring Hibernate SessionFactory using "configLocation"
property to reference Hibernate configuration file defined
above
[Next]
取消 [Specify database connection details]
[Next]
勾选 [Create SessionFactory class]
[finish]
3.3 创建数据库
3.3.1 配置  hibernate.cfg.xml 略...
4 整合 Struts
4.1 导入 Struts2 Jar 包
commons-fileupload-1.2.1
freemarker-2.3.13
ognl-2.6.11
struts2-core-2.1.6
xwork-2.1.2
4.2 导入 Spring 集成 Struts2 的插件包
struts2-spring-plugin-2.1.6
4.3 导入 Spring.jar
5 配置
5.1 配置 Struts
5.1.1 配置 web.xml 添加 struts2 支持
5.1.2 在 src 目录下创建 struts.xml
5.2 配置 Spring
5.2.1 配置 applicationContext.xml
5.2.2 修改 web.xml 添加 Spring 监听器
{编写业务}
5.3 修改 applicationContext.xml 添加 bean 配置
5.4 修改 struts.xml 修改 Action的class路径
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值