三、搭建框架
1. Create Web Project
启动MyEclipse,点击File->New->Other->MyEclipse->Java Enterprise Projects->Web Project,然后点击Next。
设置Project Name为S2SH,Location Dircetory为E:\J2EE\S2SH,J2EE Specification Level为Java EE 5.0,点击Finish。
选择File->New->Package新建如下几个包:
com.shawnqiu.action
com.shawnqiu.bean
com.shawnqiu.dao
com.shawnqiu.dao.impl
com.shawnqiu.service
com.shawnqiu.service.impl
com.shawnqiu.util
dbConfig
2. Add Struts 2.1.8.1 Capabilities
导入struts2的核心jar包(原始路径为struts-2.1.8.1-all\struts-2.1.8.1\lib),导入位置为S2SH\WebRoot\WEB-INF\lib,右键点击工程名称Refresh即可自动加入。
commons-fileupload-1.2.1.jar
commons-logging-1.0.4.jar
freemarker-2.3.15.jar
ognl-2.7.3.jar
struts2-core-2.1.8.1.jar
struts2-spring-plugin-2.1.8.1.jar
xwork-core-2.1.6.jar
3. Add Spring 2.5 Capabilities
右键点击工程名称,MyEclipse->Add Spring Capabilities。
选择Spring version为Spring 2.5,选中Spring 2.5 AOP Libraries、Spring 2.5 Core Libraries、Spring 2.5 Persistence Core Libraries、Spring 2.5 Persistence JDBC Libraries、Spring 2.5 Web Libraries共5个包。选中Copy checked Library contents to project folder (TLDs always copied),点击Next。
点击Next,点击Folder文本框后的Browse,在弹出对话框中选择spring配置文件存储位置为WebRoot/WEB-INF,点击Finish。至此已经完成加载Spring,在WEB-INF文件夹下已经生成了配置文件applicationContext.xml。
4. Create Database Connection
在SQL Server 2005中建立一个名为SSH的数据库,在数据库中新建数据表UserInfo,表中的数据项如下图所示,其中UserID为PK、自增。
在MyEclipse中选择Window->Open Perspective->MyEclipse Database Explorer,进入MyEclipse Database Explorer视图。
在DB Browser窗口中右键单击,选择New。
Connection URL为jdbc:sqlserver://localhost:1433;databaseName=SSH,选中Save password,设置完成后一定要点击Test 。Driver按钮测试一下,最后点击Next,再点击Finish。
5. Add Hibernate 3.2 Capabilities
右键点击工程名称,MyEclipse->Add Hibernate Capabilities。
选择Hibernate Specification为Hibernate 3.2,选中所有包,选中Copy checked Library Jars to project folder and add to build-path,点击Next。
选择Spring configuration file (applicationContext.xml),点击Next。
选择Existing Spring configuration file,点击Next
只需在Bean Id文本框中输入一个Id名,作为数据库源的代用名,意义不大,采用默认设置即可。然后在DB Driver下拉列表中,选择上一步在MyEclipse中创建好的数据库源SQL Server 2005,其他信息将自动填写,点击Next。
在弹出对话框中去掉Create SessionFactory class?复选框,不创建该类,点击Finish完成。
创建过程中,加载的jar包文件可能有重复,所以这个时候如果提示有某些jar包重复,选择Keep Existing即可。
6. Delete Conflictive Jars
右键点击工程名称,选择Properties->Java Build Path,删除三个重复的jar包:
asm-2.2.3.jar
cglib-2.1.3.jar
xerces-2.6.2.jar
分享到:
相关推荐
MyEclipse8.0GA注册码源文件MyEclipse8.0GA注册码源文件MyEclipse8.0GA注册码源文件MyEclipse8.0GA注册码源文件vvv
MyEclipse8.0GA What’s New MyEclipse8.0GA What’s New MyEclipse8.0GA What’s New
最简单的MyEclipse8.0GA下使用Xfire框架开发WebService实例,逐个图片讲解。
MyEclipse8.0GA注册码MyEclipse8.0GA注册码MyEclipse8.0GA注册码MyEclipse8.0GA注册码
MyEclipse 8.0GA绿色版使用手册
在网上的到的myeclipse 8.0GA KEY GEN的算法,我给打了JAR包 方便使用!
安装流程 大家开始讲解flex4的教程,如何和Myeclipse8.0整合, MyEclipse8.0正式版 and flash builder 4插件版 ,记住flex4版本支持核心3.4以上,所以最低也得按myeclipse7.5以上版本
主要介绍了在 MyEclipse8.0平台上,整合spring + struts+ hibernate 三种框架一起,建立一个ssh框架,步骤详细,并配以图解
MyEclipse8.0 GA汉化包。汉化方法:将language文件夹拷到MyEclipse8.0安装文件夹下的\MyEclipse 8.x Latest\dropins下面,然后重启MyEclipse8.0即可,简单方便。
Myeclipse10下搭建S2SH框架(图解)Struts2.1+Spring3.0+Hibernate3.3.docx
欢哉喜哉MyEclipse8.0GA终于发布了——对Struts2支持 提供下载: MyEclipse8.0GA新特性 http://usc.googlecode.com/files/MyEclipse8.0GA%20What%E2%80%99s%20New.rar Myeclipse8.0GA官方下载地址(请复制下面的...
myeclipse8.0下载地址 myeclipse8.0下载地址 有用
MyEclipse 8.0 GA正式版算号器
myeclipse8.0 汉化包myeclipse8.0 汉化包myeclipse8.0 汉化包myeclipse8.0 汉化包myeclipse8.0 汉化包myeclipse8.0 汉化包
myeclipse8.0注册码 myeclipse8.0注册码 myeclipse8.0注册码 myeclipse8.0注册码 myeclipse8.0注册码 myeclipse8.0注册码myeclipse8.0注册码
MyEclipse8.0注册码生成文件MyEclipse8.0注册码生成文件MyEclipse8.0注册码生成文件MyEclipse8.0注册码生成文件MyEclipse8.0注册码生成文件MyEclipse8.0注册码生成文件MyEclipse8.0注册码生成文件MyEclipse8.0注册码...
MyEclipse8.0_注册码MyEclipse8.0_注册码MyEclipse8.0_注册码MyEclipse8.0_注册码MyEclipse8.0_注册码MyEclipse8.0_注册码MyEclipse8.0_注册码MyEclipse8.0_注册码MyEclipse8.0_注册码MyEclipse8.0_注册码
将文档内容复制到一个.java文件中,运行在控制台操作即可得到myeclipse8.0的激活码