本工程使用MyEclipse6.01版本
一、建立java web工程
选择J2EE1.5
二、添加Spring 支持
version 2.0
jar包:core,aop,persistence,jdbc,web
包放位置:WebRoot->Web-Inf->lib
放 ApplicationContetext.xml在web->inf下面
三、添加Hibernate支持
version 3.1
jar包 : core
包放位置:WebRoot->Web-Inf->lib
用Sping的配制文件
配置SessionFactory
配置DataSource
四、添加Struts支持
五、在web.xml中添加Spring监听
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<!-- Spring Listener-->
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
注:这样整合后少一个common-pool.jar把它手动加入到lib里面
本文详细介绍了如何在MyEclipse6.01环境下搭建并整合Spring2.0、Hibernate3.1及Struts等框架,包括配置核心jar包、设置ApplicationContext.xml及web.xml等关键步骤。
1万+

被折叠的 条评论
为什么被折叠?



