使用MyEclipse工具搭建SSH框架.docVIP

  • 1
  • 0
  • 约2.19千字
  • 约 18页
  • 2016-08-20 发布于北京
  • 举报
使用MyEclipse工具搭建SSH框架.doc

使用MyEclipse8.6工具搭建SSH框架: 目录:(按下ctrl 单击跟踪) 新建web项目 导入struts2 框架 导入spring框架 导入hibernate框架 切换工作空间 导入java 项目 官网下载struts2,spring,hibernate框架(因为使用myeclipse工具搭建SSH框架,该工具已经集成这些框架,此步骤可省略)。 启动myeclipse新建web 项目,如下所示: 返回 加入struts2.1.8 支持 返回 加入spring3.0支持 返回 加入hibernate3.3支持 返回 Hibernate添加数据源 以上属于配置hibernate数据源这里开始加入hibernate框架支持 web.xml文件配置 这里使用监听器启动spring容器 实现SSH整合 思考2个问题 第一个: spring容器怎么启动? 第二个:web容器怎么启动spring容器? Web.xml文件做如下配置 !-- 初始化参数 -- context-param param-namecontextConfigLocation/param-name param-valueclasspath:applicationContext.xml/param-value /context-param !-- 监听器启动spring容器 -- listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener !-- 中文乱码处理 -- filter filter-nameCharacterEncodingFilter/filter-name filter-classorg.springframework.web.filter.CharacterEncodingFilter/filter-class init-param param-nameencoding/param-name param-valueUTF-8/param-value /init-param init-param param-nameforceEncoding/param-name param-valuetrue/param-value /init-param /filter filter-mapping filter-nameCharacterEncodingFilter/filter-name url-pattern/*/url-pattern /filter-mapping !-- Hibernate启用延迟加载 -- filter filter-namelazy/filter-name filter-classorg.springframework.orm.hibernate3.support.OpenSessionInViewFilter/filter-class /filter filter-mapping filter-namelazy/filter-name url-pattern/*/url-pattern /filter-mapping !-- 欢迎页面 -- welcome-file-list welcome-fileindex.jsp/welcome-file /welcome-file-list !-- struts2 配置 -- filter filter-namestruts2/filter-name filter-class org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter /filter-class /filter filter-mapping filter-namestruts2/filter-name url-pattern*.action/url-pattern /filter-mapping 部署运行 见JavaEE_Web开发环境配置文档.doc 这里简单介绍切换工作空间和导入java项目 切换工作空间 返回 如下

文档评论(0)

1亿VIP精品文档

相关文档