SlideShare ist ein Scribd-Unternehmen logo
1 von 29
通过 Struts 构建 Web 应用 吴卫雄
培训目的 ,[object Object],[object Object],[object Object],[object Object],[object Object]
JSP Model 2  体系结构
JSP Model 2  概述 ,[object Object]
JSP Model 2  概述 ,[object Object],[object Object],[object Object]
JSP Model 2  概述 ,[object Object]
[object Object],Struts 如何实现 Model2 与 MVC
什么是 Struts 框架? ,[object Object],[object Object],[object Object],[object Object],[object Object]
应用程序功能层
Struts  体系结构
Struts MVC 状态图 red:controller purple:model green:view
Struts  应用程序活动图
Struts  架构
Struts  顶级程序包
组件介绍 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
组件介绍 ,[object Object],ActionForm 表示 HTTP 窗体中的数据,可以将其看作是模型和视图的中介,它负责保存视图中的数据供模型或者视图使用。 Struts 1.1 文档中把它比作 HTTP 和 Action 之间的防火墙,这体现了 ActionForm 具有的过滤保护的作用,只有通过 ActionForm 验证的数据才能够发送到 Action 处理。  ActionForm 是与一个或多个 ActionConfig 关联的 JavaBean ,在相应的 action 的 execute 方法被调用之前, ActionForm 会自动利用请求参数来填充自己(初始化属性)。  ActionForm 是一个抽象类,你必须通过继承来实现自己的类。  ActionForm 首先利用属性的 getter 和 setter 方法来实现初始化,初始化完毕后, ActionForm 的 validate 方法被调用,你可以在其中来检查请求参数的正确性和有效性,并且可以将错误信息以 ActionErrors 的形式返回到输入窗体。否则, ActionForm 将被作为参数传给 action 的 execute 方法以供使用。
组件介绍 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
组件介绍 ,[object Object],控制器通过动作和请求信息相对应的映射配置说明什么信息转发到什么 Action 类。这些配置映射信息是存储在特定的 XML 文件(比如 struts-config.xml )。 这些配置信息在系统启动的时候被读入内存,供 struts framework 在运行期间使用。 在内存中,每一个 <action> 元素都与 org.apache.struts.action.ActionMapping 类的一个实例对应。
组件介绍 转移控制对象( ActionForward ) 用来抉择当一个 Action 结束时控制器将指示操作转移的对象。这个对象可以在配置文件里进行配置。
组件介绍 ActionError 用来存储和回收错误。
J2EE 应用目录结构 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
范例
范例
范例
范例
范例
范例
推荐阅读 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
THANK YOU!

Weitere ähnliche Inhalte

Was ist angesagt?

twMVC#01 | ASP.NET MVC 的第一次親密接觸
twMVC#01 | ASP.NET MVC 的第一次親密接觸twMVC#01 | ASP.NET MVC 的第一次親密接觸
twMVC#01 | ASP.NET MVC 的第一次親密接觸twMVC
 
twMVC#05 |開發與移轉 ASP.NET MVC 4.0 應用程式到 Windows Azure Platform
twMVC#05 |開發與移轉 ASP.NET MVC 4.0 應用程式到 Windows Azure PlatformtwMVC#05 |開發與移轉 ASP.NET MVC 4.0 應用程式到 Windows Azure Platform
twMVC#05 |開發與移轉 ASP.NET MVC 4.0 應用程式到 Windows Azure PlatformtwMVC
 
ASP.NET MVC 4 新功能介紹(快速上手) -twMVC#4
ASP.NET MVC 4 新功能介紹(快速上手) -twMVC#4ASP.NET MVC 4 新功能介紹(快速上手) -twMVC#4
ASP.NET MVC 4 新功能介紹(快速上手) -twMVC#4twMVC
 
ASP.Net MVC2 简介
ASP.Net MVC2 简介ASP.Net MVC2 简介
ASP.Net MVC2 简介Allen Lsy
 
Silverlight 开发简介
Silverlight 开发简介Silverlight 开发简介
Silverlight 开发简介beginor
 
Role Based Access Control Fundamental
Role Based Access Control FundamentalRole Based Access Control Fundamental
Role Based Access Control Fundamentalchuan liang
 
Asp.net mvc 概觀介紹
Asp.net mvc 概觀介紹Asp.net mvc 概觀介紹
Asp.net mvc 概觀介紹Alan Tsai
 
浅析主流商业和开源Esb产品
浅析主流商业和开源Esb产品浅析主流商业和开源Esb产品
浅析主流商业和开源Esb产品nereuschen
 
架構行動式網站(使用 ASP.NET MVC 4.0 -twMVC#6
架構行動式網站(使用 ASP.NET MVC 4.0 -twMVC#6架構行動式網站(使用 ASP.NET MVC 4.0 -twMVC#6
架構行動式網站(使用 ASP.NET MVC 4.0 -twMVC#6twMVC
 
ASP.NET MVC Model 的設計與使用 twMVC#10
ASP.NET MVC Model 的設計與使用 twMVC#10ASP.NET MVC Model 的設計與使用 twMVC#10
ASP.NET MVC Model 的設計與使用 twMVC#10twMVC
 
十个最好的Java性能故障排除工具
十个最好的Java性能故障排除工具十个最好的Java性能故障排除工具
十个最好的Java性能故障排除工具wensheng wei
 
Kiss开发平台简介
Kiss开发平台简介Kiss开发平台简介
Kiss开发平台简介cecepig
 
ASP.NET MVC 內建驗證擴充與活用技巧 -twMVC#3
ASP.NET MVC 內建驗證擴充與活用技巧 -twMVC#3ASP.NET MVC 內建驗證擴充與活用技巧 -twMVC#3
ASP.NET MVC 內建驗證擴充與活用技巧 -twMVC#3twMVC
 
Struts Mitac(1)
Struts Mitac(1)Struts Mitac(1)
Struts Mitac(1)wangjiaz
 
ASP.NET MVC 新增、查詢、修改、刪除 基本功實戰 -twMVC#3
ASP.NET MVC 新增、查詢、修改、刪除 基本功實戰 -twMVC#3ASP.NET MVC 新增、查詢、修改、刪除 基本功實戰 -twMVC#3
ASP.NET MVC 新增、查詢、修改、刪除 基本功實戰 -twMVC#3twMVC
 

Was ist angesagt? (18)

twMVC#01 | ASP.NET MVC 的第一次親密接觸
twMVC#01 | ASP.NET MVC 的第一次親密接觸twMVC#01 | ASP.NET MVC 的第一次親密接觸
twMVC#01 | ASP.NET MVC 的第一次親密接觸
 
twMVC#05 |開發與移轉 ASP.NET MVC 4.0 應用程式到 Windows Azure Platform
twMVC#05 |開發與移轉 ASP.NET MVC 4.0 應用程式到 Windows Azure PlatformtwMVC#05 |開發與移轉 ASP.NET MVC 4.0 應用程式到 Windows Azure Platform
twMVC#05 |開發與移轉 ASP.NET MVC 4.0 應用程式到 Windows Azure Platform
 
ASP.NET MVC 4 新功能介紹(快速上手) -twMVC#4
ASP.NET MVC 4 新功能介紹(快速上手) -twMVC#4ASP.NET MVC 4 新功能介紹(快速上手) -twMVC#4
ASP.NET MVC 4 新功能介紹(快速上手) -twMVC#4
 
ASP.Net MVC2 简介
ASP.Net MVC2 简介ASP.Net MVC2 简介
ASP.Net MVC2 简介
 
Silverlight 开发简介
Silverlight 开发简介Silverlight 开发简介
Silverlight 开发简介
 
Esb
EsbEsb
Esb
 
Role Based Access Control Fundamental
Role Based Access Control FundamentalRole Based Access Control Fundamental
Role Based Access Control Fundamental
 
Asp.net mvc 概觀介紹
Asp.net mvc 概觀介紹Asp.net mvc 概觀介紹
Asp.net mvc 概觀介紹
 
浅析主流商业和开源Esb产品
浅析主流商业和开源Esb产品浅析主流商业和开源Esb产品
浅析主流商业和开源Esb产品
 
Mvc
MvcMvc
Mvc
 
架構行動式網站(使用 ASP.NET MVC 4.0 -twMVC#6
架構行動式網站(使用 ASP.NET MVC 4.0 -twMVC#6架構行動式網站(使用 ASP.NET MVC 4.0 -twMVC#6
架構行動式網站(使用 ASP.NET MVC 4.0 -twMVC#6
 
ASP.NET MVC Model 的設計與使用 twMVC#10
ASP.NET MVC Model 的設計與使用 twMVC#10ASP.NET MVC Model 的設計與使用 twMVC#10
ASP.NET MVC Model 的設計與使用 twMVC#10
 
十个最好的Java性能故障排除工具
十个最好的Java性能故障排除工具十个最好的Java性能故障排除工具
十个最好的Java性能故障排除工具
 
Kiss开发平台简介
Kiss开发平台简介Kiss开发平台简介
Kiss开发平台简介
 
Mvp
MvpMvp
Mvp
 
ASP.NET MVC 內建驗證擴充與活用技巧 -twMVC#3
ASP.NET MVC 內建驗證擴充與活用技巧 -twMVC#3ASP.NET MVC 內建驗證擴充與活用技巧 -twMVC#3
ASP.NET MVC 內建驗證擴充與活用技巧 -twMVC#3
 
Struts Mitac(1)
Struts Mitac(1)Struts Mitac(1)
Struts Mitac(1)
 
ASP.NET MVC 新增、查詢、修改、刪除 基本功實戰 -twMVC#3
ASP.NET MVC 新增、查詢、修改、刪除 基本功實戰 -twMVC#3ASP.NET MVC 新增、查詢、修改、刪除 基本功實戰 -twMVC#3
ASP.NET MVC 新增、查詢、修改、刪除 基本功實戰 -twMVC#3
 

Andere mochten auch

敏捷开发的必要技巧完整版
敏捷开发的必要技巧完整版敏捷开发的必要技巧完整版
敏捷开发的必要技巧完整版yiditushe
 
小超人導讀 第2章
小超人導讀 第2章小超人導讀 第2章
小超人導讀 第2章奕孝 陳
 
Quintin Oliver presentation to October 2009 CBI (NI)/ Stratagem Conference
Quintin Oliver presentation to October 2009 CBI (NI)/ Stratagem ConferenceQuintin Oliver presentation to October 2009 CBI (NI)/ Stratagem Conference
Quintin Oliver presentation to October 2009 CBI (NI)/ Stratagem Conferencestratagemni
 
Mila pitch report china
Mila pitch report chinaMila pitch report china
Mila pitch report chinaRobert Halasz
 

Andere mochten auch (7)

Ccs
CcsCcs
Ccs
 
敏捷开发的必要技巧完整版
敏捷开发的必要技巧完整版敏捷开发的必要技巧完整版
敏捷开发的必要技巧完整版
 
小超人導讀 第2章
小超人導讀 第2章小超人導讀 第2章
小超人導讀 第2章
 
Franchise Matchingday am 16.11.2013 in Mainz
Franchise Matchingday am 16.11.2013 in MainzFranchise Matchingday am 16.11.2013 in Mainz
Franchise Matchingday am 16.11.2013 in Mainz
 
Quintin Oliver presentation to October 2009 CBI (NI)/ Stratagem Conference
Quintin Oliver presentation to October 2009 CBI (NI)/ Stratagem ConferenceQuintin Oliver presentation to October 2009 CBI (NI)/ Stratagem Conference
Quintin Oliver presentation to October 2009 CBI (NI)/ Stratagem Conference
 
Cordenadas
CordenadasCordenadas
Cordenadas
 
Mila pitch report china
Mila pitch report chinaMila pitch report china
Mila pitch report china
 

Ähnlich wie 通过Struts构建Web应用

Struts学习笔记
Struts学习笔记Struts学习笔记
Struts学习笔记yiditushe
 
Struts快速学习指南
Struts快速学习指南Struts快速学习指南
Struts快速学习指南yiditushe
 
J2ee经典学习笔记
J2ee经典学习笔记J2ee经典学习笔记
J2ee经典学习笔记yiditushe
 
網站設計100步
網站設計100步網站設計100步
網站設計100步evercislide
 
Struts+Spring+Hibernate整合教程
Struts+Spring+Hibernate整合教程Struts+Spring+Hibernate整合教程
Struts+Spring+Hibernate整合教程yiditushe
 
Struts+Spring+Hibernate整合教程
Struts+Spring+Hibernate整合教程Struts+Spring+Hibernate整合教程
Struts+Spring+Hibernate整合教程appollo0312
 
Real World ASP.NET MVC
Real World ASP.NET MVCReal World ASP.NET MVC
Real World ASP.NET MVCjeffz
 
基于J2 Ee 的通用Web 信息系统框架设计与实现
基于J2 Ee 的通用Web 信息系统框架设计与实现基于J2 Ee 的通用Web 信息系统框架设计与实现
基于J2 Ee 的通用Web 信息系统框架设计与实现yiditushe
 
JdonFramework中文
JdonFramework中文JdonFramework中文
JdonFramework中文banq jdon
 
Mvc training
Mvc trainingMvc training
Mvc trainingxioxu
 
Ajax Lucence
Ajax LucenceAjax Lucence
Ajax LucenceRoger Xia
 
Asp.net mvc 從無到有 -twMVC#2
Asp.net mvc 從無到有 -twMVC#2Asp.net mvc 從無到有 -twMVC#2
Asp.net mvc 從無到有 -twMVC#2twMVC
 
twMVC#02 | ASP.NET MVC 從無到有
twMVC#02 | ASP.NET MVC 從無到有twMVC#02 | ASP.NET MVC 從無到有
twMVC#02 | ASP.NET MVC 從無到有twMVC
 
twMVC#04 | ASP.NET MVC 4 新功能介紹(快速上手)
twMVC#04 | ASP.NET MVC 4 新功能介紹(快速上手)twMVC#04 | ASP.NET MVC 4 新功能介紹(快速上手)
twMVC#04 | ASP.NET MVC 4 新功能介紹(快速上手)twMVC
 
twMVC#10 | ASP.NET MVC Model 的設計與使用
twMVC#10 | ASP.NET MVC Model 的設計與使用twMVC#10 | ASP.NET MVC Model 的設計與使用
twMVC#10 | ASP.NET MVC Model 的設計與使用twMVC
 
ASP.NET Core MVC 2.2從開發到測試 - Development & Unit Testing
ASP.NET Core MVC 2.2從開發到測試 - Development & Unit TestingASP.NET Core MVC 2.2從開發到測試 - Development & Unit Testing
ASP.NET Core MVC 2.2從開發到測試 - Development & Unit Testing江華 奚
 
Spring 2.0 技術手冊第十章 - 專案:線上書籤
Spring 2.0 技術手冊第十章 - 專案:線上書籤Spring 2.0 技術手冊第十章 - 專案:線上書籤
Spring 2.0 技術手冊第十章 - 專案:線上書籤Justin Lin
 

Ähnlich wie 通过Struts构建Web应用 (20)

Struts学习笔记
Struts学习笔记Struts学习笔记
Struts学习笔记
 
Struts快速学习指南
Struts快速学习指南Struts快速学习指南
Struts快速学习指南
 
J2ee经典学习笔记
J2ee经典学习笔记J2ee经典学习笔记
J2ee经典学习笔记
 
網站設計100步
網站設計100步網站設計100步
網站設計100步
 
Struts+Spring+Hibernate整合教程
Struts+Spring+Hibernate整合教程Struts+Spring+Hibernate整合教程
Struts+Spring+Hibernate整合教程
 
Struts+Spring+Hibernate整合教程
Struts+Spring+Hibernate整合教程Struts+Spring+Hibernate整合教程
Struts+Spring+Hibernate整合教程
 
Real World ASP.NET MVC
Real World ASP.NET MVCReal World ASP.NET MVC
Real World ASP.NET MVC
 
基于J2 Ee 的通用Web 信息系统框架设计与实现
基于J2 Ee 的通用Web 信息系统框架设计与实现基于J2 Ee 的通用Web 信息系统框架设计与实现
基于J2 Ee 的通用Web 信息系统框架设计与实现
 
JdonFramework中文
JdonFramework中文JdonFramework中文
JdonFramework中文
 
敦群學院-SharePoint精英計畫-系統開發-Day 3
敦群學院-SharePoint精英計畫-系統開發-Day 3敦群學院-SharePoint精英計畫-系統開發-Day 3
敦群學院-SharePoint精英計畫-系統開發-Day 3
 
Mvc training
Mvc trainingMvc training
Mvc training
 
Ajax Lucence
Ajax LucenceAjax Lucence
Ajax Lucence
 
Asp.net mvc 從無到有 -twMVC#2
Asp.net mvc 從無到有 -twMVC#2Asp.net mvc 從無到有 -twMVC#2
Asp.net mvc 從無到有 -twMVC#2
 
twMVC#02 | ASP.NET MVC 從無到有
twMVC#02 | ASP.NET MVC 從無到有twMVC#02 | ASP.NET MVC 從無到有
twMVC#02 | ASP.NET MVC 從無到有
 
twMVC#04 | ASP.NET MVC 4 新功能介紹(快速上手)
twMVC#04 | ASP.NET MVC 4 新功能介紹(快速上手)twMVC#04 | ASP.NET MVC 4 新功能介紹(快速上手)
twMVC#04 | ASP.NET MVC 4 新功能介紹(快速上手)
 
Jsp
JspJsp
Jsp
 
twMVC#10 | ASP.NET MVC Model 的設計與使用
twMVC#10 | ASP.NET MVC Model 的設計與使用twMVC#10 | ASP.NET MVC Model 的設計與使用
twMVC#10 | ASP.NET MVC Model 的設計與使用
 
ASP.NET Core MVC 2.2從開發到測試 - Development & Unit Testing
ASP.NET Core MVC 2.2從開發到測試 - Development & Unit TestingASP.NET Core MVC 2.2從開發到測試 - Development & Unit Testing
ASP.NET Core MVC 2.2從開發到測試 - Development & Unit Testing
 
Exodus2 大局观
Exodus2 大局观Exodus2 大局观
Exodus2 大局观
 
Spring 2.0 技術手冊第十章 - 專案:線上書籤
Spring 2.0 技術手冊第十章 - 專案:線上書籤Spring 2.0 技術手冊第十章 - 專案:線上書籤
Spring 2.0 技術手冊第十章 - 專案:線上書籤
 

Mehr von yiditushe

Spring入门纲要
Spring入门纲要Spring入门纲要
Spring入门纲要yiditushe
 
J Bpm4 1中文用户手册
J Bpm4 1中文用户手册J Bpm4 1中文用户手册
J Bpm4 1中文用户手册yiditushe
 
性能测试实践2
性能测试实践2性能测试实践2
性能测试实践2yiditushe
 
性能测试实践1
性能测试实践1性能测试实践1
性能测试实践1yiditushe
 
性能测试技术
性能测试技术性能测试技术
性能测试技术yiditushe
 
Load runner测试技术
Load runner测试技术Load runner测试技术
Load runner测试技术yiditushe
 
J2 ee性能测试
J2 ee性能测试J2 ee性能测试
J2 ee性能测试yiditushe
 
面向对象的Js培训
面向对象的Js培训面向对象的Js培训
面向对象的Js培训yiditushe
 
Flex3中文教程
Flex3中文教程Flex3中文教程
Flex3中文教程yiditushe
 
开放源代码的全文检索Lucene
开放源代码的全文检索Lucene开放源代码的全文检索Lucene
开放源代码的全文检索Luceneyiditushe
 
基于分词索引的全文检索技术介绍
基于分词索引的全文检索技术介绍基于分词索引的全文检索技术介绍
基于分词索引的全文检索技术介绍yiditushe
 
Lucene In Action
Lucene In ActionLucene In Action
Lucene In Actionyiditushe
 
Lucene2 4学习笔记1
Lucene2 4学习笔记1Lucene2 4学习笔记1
Lucene2 4学习笔记1yiditushe
 
Lucene2 4 Demo
Lucene2 4 DemoLucene2 4 Demo
Lucene2 4 Demoyiditushe
 
Lucene 全文检索实践
Lucene 全文检索实践Lucene 全文检索实践
Lucene 全文检索实践yiditushe
 
Lucene 3[1] 0 原理与代码分析
Lucene 3[1] 0 原理与代码分析Lucene 3[1] 0 原理与代码分析
Lucene 3[1] 0 原理与代码分析yiditushe
 
7 面向对象设计原则
7 面向对象设计原则7 面向对象设计原则
7 面向对象设计原则yiditushe
 
10 团队开发
10  团队开发10  团队开发
10 团队开发yiditushe
 
9 对象持久化与数据建模
9  对象持久化与数据建模9  对象持久化与数据建模
9 对象持久化与数据建模yiditushe
 
8 Uml构架建模
8  Uml构架建模8  Uml构架建模
8 Uml构架建模yiditushe
 

Mehr von yiditushe (20)

Spring入门纲要
Spring入门纲要Spring入门纲要
Spring入门纲要
 
J Bpm4 1中文用户手册
J Bpm4 1中文用户手册J Bpm4 1中文用户手册
J Bpm4 1中文用户手册
 
性能测试实践2
性能测试实践2性能测试实践2
性能测试实践2
 
性能测试实践1
性能测试实践1性能测试实践1
性能测试实践1
 
性能测试技术
性能测试技术性能测试技术
性能测试技术
 
Load runner测试技术
Load runner测试技术Load runner测试技术
Load runner测试技术
 
J2 ee性能测试
J2 ee性能测试J2 ee性能测试
J2 ee性能测试
 
面向对象的Js培训
面向对象的Js培训面向对象的Js培训
面向对象的Js培训
 
Flex3中文教程
Flex3中文教程Flex3中文教程
Flex3中文教程
 
开放源代码的全文检索Lucene
开放源代码的全文检索Lucene开放源代码的全文检索Lucene
开放源代码的全文检索Lucene
 
基于分词索引的全文检索技术介绍
基于分词索引的全文检索技术介绍基于分词索引的全文检索技术介绍
基于分词索引的全文检索技术介绍
 
Lucene In Action
Lucene In ActionLucene In Action
Lucene In Action
 
Lucene2 4学习笔记1
Lucene2 4学习笔记1Lucene2 4学习笔记1
Lucene2 4学习笔记1
 
Lucene2 4 Demo
Lucene2 4 DemoLucene2 4 Demo
Lucene2 4 Demo
 
Lucene 全文检索实践
Lucene 全文检索实践Lucene 全文检索实践
Lucene 全文检索实践
 
Lucene 3[1] 0 原理与代码分析
Lucene 3[1] 0 原理与代码分析Lucene 3[1] 0 原理与代码分析
Lucene 3[1] 0 原理与代码分析
 
7 面向对象设计原则
7 面向对象设计原则7 面向对象设计原则
7 面向对象设计原则
 
10 团队开发
10  团队开发10  团队开发
10 团队开发
 
9 对象持久化与数据建模
9  对象持久化与数据建模9  对象持久化与数据建模
9 对象持久化与数据建模
 
8 Uml构架建模
8  Uml构架建模8  Uml构架建模
8 Uml构架建模
 

通过Struts构建Web应用