ITeye博客

Struts 笔记 之 比较乱

namezhou · 2010-07-28 22:11 · Struts · 企业架构 · Spring · Struts · 领域模型 · Hibernate · Web · Markdown

domain model 领域模型 --- 核心业务 --- 不应该掺杂其他的东西
DDD 领域驱动设计
pattern 模式
framwork 框架

struts  表现层
spring 业务逻辑层
hibernate 持久化层

手动引入struts流程

1.拷贝struts 的jar包到web-inf的lib目录
2.在web.xml中配置ActionServlet自动启动
3.提供struts-config.xml到web-inf目录

创建jsp 添加表单
创建FormBean 继承ActionForm
 创建与表单元素对应的属性,添加getter、setter
创建Actiobe 继承Action
编辑action 处理请求

编辑struts-config.xml
 添加form标签
 <form-beans>
  <form-bean name="xxx" type="全类名" />
 </form-beans>
 添加action
 <action-mappings>
  <action path="/login"
  type="全类名"
  name="处理Action的Formbean的名字"
  scope="默认session,生成的formBean对象的作用域"
  />
  <forward name="success" path="" />
  <forward name="error" path="" /s>
 </action-mappings>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。