logo资料库

SSM(Eclipse+Struts2+Spring+MyBatis)环境搭建.docx

第1页 / 共50页
第2页 / 共50页
第3页 / 共50页
第4页 / 共50页
第5页 / 共50页
第6页 / 共50页
第7页 / 共50页
第8页 / 共50页
资料共50页,剩余部分请下载后查看
1.准备安装文件
Struts2
Spring
MyBatis
2.新建WEB工程
3.配置Tomcat服务器
4.配置Structs2
搭建环境
编写一个action验证配置正确性
增加异常处理机制
5.整合spring
复制struts-spring插件包
复制springJAR包
修改web.xml
创建applicationContext.xml
新建好package
在applicationContext.xml中添加组件注入选项
将action的创建托管给spring容器
验证业务组件的自动注入
6.整合MyBatis
复制MyBatis的JAR包
安装MyBatis Generator插件
创建数据库测试对象
创建generatorConfig.xml文件
通过generatorConfig.xml文件生成DAO对象、映射文件
JDBC驱动 JAR包
新建mybatis-config.xml
做一个简单的查询测试
log4j属性文件
完成MyBatis与Spring的整合
7.整合jQuery
8.实现struts JSON
1. 准备安装文件 库类型 版本 文件名 下载地址 以下为需要准备的文件清单,从相应网址下载到本地,表格中列出的版本号是截止到 2012 年 5 月 6 日的最新版本。 序 号 1 2 Struts2 Spring 2.3.3 3.1.0 http://struts.apache.org/ http://springframework.org/ struts-2.3.3-all.gz spring-framework-3.1.1.RELEASE-with-d ocs.zip mybatis-3.1.1-bundle.zip mybatis-spring-1.1.1-bundle.zip mybatis-generator-core-1.3.1-bundle.zip jquery-1.7.2.js http://code.google.com/p/mybatis/ http://jquery.com/ eclipse-jee-indigo-SR2-win32.zip http://www.eclipse.org/downloads/ apache-tomcat-7.0.27-windows-x86.zip http://tomcat.apache.org/ 3 4 4 5 Mybatis 3.1.1 jquery 1.7.2 Eclipse tomcat Eclipse IDE for Java EE Developers, 7.0.27
Struts2 下载包含了库和代码、例子的全包:struts-2.3.3-all.gz,大约在 76m,文件较大,但其中的 空应用例程可作为直接拷贝的参考。
Spring 下载包含了库和代码、例子的全包:spring-framework-3.1.1.RELEASE-with-docs.zip MyBatis
2. 新建 WEB 工程 选择 WEB 下 Dynamic Web Project 类型的工程:
工程命名为 EMS,其它选项保持默认。
文件夹名保持默认
勾上生成 web.xml 选项,其它保持默认。
最后得到一个如下组织的 WEB 工程.
分享到:
收藏