美文网首页
Spring + Struts + Mybatis整合

Spring + Struts + Mybatis整合

作者: 静海潜蛟 | 来源:发表于2017-06-09 08:02 被阅读45次

Struts2 + Spring + Mybatis开发步骤

1.搭建开发环境

1.1 导包

|--- Spring相关

|--- Struts2相关

|--- Mybatis相关

|--- 数据库连接驱动

1.2 引入配置文件

web.xml

struts.xml

XxxDAPMapper.xml

applicationContext.xml

1.3 配置applicationContext.xml

1.3.1 配置数据库连接参数

1.3.2 配置SqlSessionFactory

2. 编码

2.1 entity——实体类

2.1 table——表

2.2 DAO

2.3 XxxDAOMapper.xml

2.4 Service

2.5 ServiceImpl

2.6 配置额外功能(applicationContext.xml)

2.6.1 原始对象

2.6.2 额外功能

2.6.3 切入点

2.6.4 组装切面

2.7 XxxAction implements ActionSupport

2.8 applicationContext.xml中注入xxxService

2.9 配置struts.xml

3.0 配置web.xml


相关文章

网友评论

      本文标题:Spring + Struts + Mybatis整合

      本文链接:https://www.haomeiwen.com/subject/crsxqxtx.html