myeclipse框架搭建步骤.pdfVIP

  • 2
  • 0
  • 约9.7千字
  • 约 25页
  • 2022-08-16 发布于山东
  • 举报
Myeclipse ssh 框架搭建步骤 1 项目创建 1.1 创建web 项目 1.2 添加jar 包到lib 目录下 由于直接使用myeclipse 添加ssh 特性导致jar 包冲突,因此事先把jar 包添加到 创建的项目 webroot 下 web-inf 文件夹 lib 目录下 1 添加完后,这些jar包自动添加到classpath 2 添加spring 2.1 添加spring特性 由于已添加了 spring 的jar包,因此不选任何jar包 2 3 生成applicationContext.xml 配置文件,点击finish 。 2.2 打开applicationContext.xml 文件,把常用的命名空间加入 ?xml version=1.0 encoding=UTF-8? beans xmlns= :// springframework.org/schema/beans xmlns:xsi= :// w3.org/2001/XMLSchema-instance xmlns:context= :// springframework.org/schema/context xmlns:aop= :// springframework.org/schema/aop xmlns:tx= :// springframework.org/schema/tx xsi:schemaLocation= :// springframework.org/schema/beans 4 :// springframework.org/schema/beans/spring-beans-3.0.xsd :// springframework.org/schema/context :// springframework.org/schema/context/spring-context-3.0.xsd :// springframework.org/schema/aop :// springframework.org/schema/aop/spring-aop-3.0.xsd :// springframework.org/schema/tx :// springframework.org/schema/tx/spring-tx-3.0.xsd /beans 2.3 在web.xml 中添加spring 监听: context-param param-namecontextConfigLocation/param-name param-value/WEB-INF/classes/applicationContext*.xml/para m-value /context-param listene listener-classorg.springframework.web.context.ContextLoad erListene /listener-class /listene 配置监听的目的: ContextLoaderListener 的作用就是启动Web 容器时,自动装配ApplicationContext 的配置信息。 3 添加hibernate 3.1 数据库连接驱动

文档评论(0)

1亿VIP精品文档

相关文档