SSH框架搭建【精校版本】

上传人:8** 文档编号:172428577 上传时间:2021-03-09 格式:DOC 页数:17 大小:1.33MB
返回 下载 相关 举报
SSH框架搭建【精校版本】_第1页
第1页 / 共17页
SSH框架搭建【精校版本】_第2页
第2页 / 共17页
SSH框架搭建【精校版本】_第3页
第3页 / 共17页
SSH框架搭建【精校版本】_第4页
第4页 / 共17页
SSH框架搭建【精校版本】_第5页
第5页 / 共17页
亲,该文档总共17页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《SSH框架搭建【精校版本】》由会员分享,可在线阅读,更多相关《SSH框架搭建【精校版本】(17页珍藏版)》请在金锄头文库上搜索。

1、Myeclipse10下搭建SSH框架(图解)Struts2.1+Spring3.0+Hibernate3.32012-04-11 18:38:28|分类:Web Development|标签:myeclipsesshstrutsspringhibernate|举报|字号订阅下载LOFTER客户端一、建立一个Web Project点击FileNewWeb Project 新建一个Web工程。在Project Name中输入项目名ssh,在J2EE Specification Level中选择Java EE 6.0,然后点击Finish。二、搭建Spring3.0左边显示的是生成以后的Web P

2、roject 目录结构。选择工程名(ssh),然后添加Spring。MyEclipseProject CapabilitiesAdd Spring CapabilitiesSpring version选择Spring 3.0按图选择相应的包Spring 3.0 AOP,Spring 3.0 Core,Spring 3.0 Persistence Core,Spring 3.0 Persistence JDBC,Spring 3.0 Web;JAR Library Installation里选择Copy到lib目录(避免发布到Tomcat出问题)。生成applicationContext.xml

3、文件,Folder中选择WebRoot/WEB-INF,然后点击Finish。三、搭建Hibernate3.3左边显示的是生成Spring以后的目录结构(文件夹上面会有个S)。选择工程名(ssh),然后添加Hibernate。MyEclipseProject CapabilitiesAdd Hibernate CapabilitiesHibernate Specification选择Hibernate 3.3按图选择相应的包Hibernate 3.3 Annotations & Entity Manager,Hibernate 3.3 Core;JAR Library Installation

4、里选择Copy到lib目录(避免发布到Tomcat出问题)。这里统一由Spring configuration file管理Hibernate。选择继承的Spring配置文件(WebRoot/WEB-INF/applicationContext.xml),SessionFactory Id默认。这里配置数据库连接,这里不打勾Specify Spring DataSource connection details,点击Next。如果要建可以在DB Browser(WindowsShow ViewOtherMyEclipse DatabaseDB Browser)里面新建。不打勾Create Se

5、ssionFactory class,点击Finish。四、搭建Struts2.1左边显示的是生成Hibernate以后的目录结构,这里用Spring管理所以看不到hibernate.cfg.xml文件了。选择工程名(ssh),然后添加Struts。MyEclipseProject CapabilitiesAdd Struts CapabilitiesStruts specification里选择Struts2.1,Struts 2 filter name默认,点击Next。加入Struts核心包,点击Finish。到此SSH环境就已经搭建好了。下面开启服务看看对不对?五、启动Tomcat服务

6、器,看搭建成功没?在web.xml里面加个监听Spring。org.springframework.web.context.ContextLoaderListener在Servers里面点击Add Deployments。这个是MyEclipse自带的TOMCAT6.0.13。把工程发布到Tomcat上。点击Run Server启动。Console控制台里面启动完成,Spring也启动起来了。打开IE输入:http:/localhost:8080/ssh 正常显示环境已经没有问题,在此框架基础上可以扩展了。生成之后所用到的包WebRoot/WEB-INF/libantlr-2.7.6.jarc

7、glib-.mchange.v2.c3p0-.sf.cglib-2.2.0.jarcom.springsource.org.aopalliance-mons.fileupload-mons.httpclient-mons.lang-mons.logging-mons.pool-1.5.3.jarcom.springsource.org.apache.log4j-1.2.15.jarcom.springsource.org.aspectj.weaver-1.6.8.RELEASE.jarcom.springsource.org.codehaus.jackson.mapper-1.0.0.jarc

8、ommons-collections-3.1.jarcommons-dbcp.jardom4j-1.6.1.jarehcache-1.2.3.jarejb3-persistence.jarhibernate-annotations.jarhibernate-commons-annotations.jarhibernate-entitymanager.jarhibernate-validator.jarhibernate3.jarjavassist-3.9.0.GA.jarjotm.jarjta-1.1.jarlog4j-1.2.14.jarmysql-connector-java-5.1.18

9、-bin.jarname.txtorg.springframework.aop-3.0.5.RELEASE.jarorg.springframework.asm-3.0.5.RELEASE.jarorg.springframework.aspects-3.0.5.RELEASE.jarorg.springframework.beans-3.0.5.RELEASE.jarorg.springframework.context-3.0.5.RELEASE.jarorg.springframework.core-3.0.5.RELEASE.jarorg.springframework.express

10、ion-3.0.5.RELEASE.jarorg.springframework.instrument-3.0.5.RELEASE.jarorg.springframework.instrument.tomcat-3.0.5.RELEASE.jarorg.springframework.jdbc-3.0.5.RELEASE.jarorg.springframework.orm-3.0.5.RELEASE.jarorg.springframework.oxm-3.0.5.RELEASE.jarorg.springframework.transaction-3.0.5.RELEASE.jarorg

11、.springframework.web-3.0.5.RELEASE.jarorg.springframework.web.portlet-3.0.5.RELEASE.jarorg.springframework.web.servlet-3.0.5.RELEASE.jarorg.springframework.web.struts-3.0.5.RELEASE.jarpersistence.jarslf4j-api-1.5.8.jarslf4j-log4j12-1.5.8.jarxapool.jarStruts 2.1 Core Librariesantlr-2.7.2.jaraopallian

12、ce-1.0.jarclassworlds-1.1.jarcommons-beanutils-1.7.0.jarcommons-chain-1.2.jarcommons-collections-3.2.jarcommons-digester-2.0.jarcommons-fileupload-1.2.1.jarcommons-io-1.3.2.jarcommons-lang-2.3.jarcommons-logging-1.0.4.jarcommons-logging-api-1.1.jarcommons-validator-1.3.1.jarfreemarker-2.3.16.jarjavassist-3.7.ga.jarjson-lib-2.1-jdk15.jarname.txtognl-3.0.jaroro-2.0.8.jarsslext-1.2-0.jarstruts2-convention-plugin-2.2.1.jarstruts2-core-2.2.1.jarstruts2-embeddedjsp-plugin-2.2.1.jarstruts2-json-plugin-2.2.1.jarxwork-core-2.2.1.jar17优异品+

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 医学/心理学 > 基础医学

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号