今天开始学习struts2,先研究下体系结构

In the diagram, an initial request goes to the Servlet container (such as Jetty or Resin) which is passed through a standard filter chain. The chain includes the (optional) ActionContextCleanUp filter, which is useful when integrating technologies such as SiteMesh Plugin. Next, the required FilterDispatcher is called, which in turn consults the ActionMapper to determine if the request should invoke an action.

If the ActionMapper determines that an Action should be invoked, the FilterDispatcher delegates control to the ActionProxy. The ActionProxy consults the framework Configuration Files manager (initialized from the struts.xml file). Next, the ActionProxy creates an ActionInvocation, which is responsible for the command pattern implementation. This includes invoking any Interceptors (the before clause) in advance of invoking the Action itself.

Once the Action returns, the ActionInvocation is responsible for looking up the proper result associated with the Action result code mapped in struts.xml. The result is then executed, which often (but not always, as is the case for Action Chaining) involves a template written in JSP or FreeMarker to be rendered. While rendering, the templates can use the Struts Tags provided by the framework. Some of those components will work with the ActionMapper to render proper URLs for additional requests.

All objects in this architecture (Actions, Results, Interceptors, and so forth) are created by an ObjectFactory. This ObjectFactory is pluggable. We can provide our own ObjectFactory for any reason that requires knowing when objects in the framework are created. A popular ObjectFactory implementation uses Spring as provided by the Spring Plugin.

Interceptors are executed again (in reverse order, calling the after clause). Finally, the response returns through the filters configured in the web.xml. If the ActionContextCleanUp filter is present, the FilterDispatcher will not clean up the ThreadLocal ActionContext. If the ActionContextCleanUp filter is not present, the FilterDispatcher will cleanup all ThreadLocals.

struts2 体系结构相关推荐

  1. Struts2笔记——初次框架配置

    1.Struts2简介   Struts 2是Struts的下一代产品,是在 struts 1和WebWork的技术基础上进行了合并的全新的Struts 2框架.其全新的Struts 2的体系结构与S ...

  2. Struts2学习入门

    Struts 2 教程 Apache的Struts2是一个优雅的,可扩展的框架,用于创建企业准备的Java Web应用程序.该框架旨在简化整个开发周期,从构建,部署,维护应用程序随着时间的推移. Ap ...

  3. 【struts2】struts2简介

    Struts2其实并不是一个陌生的Web框架,Struts2是以Webwork的设计思想为核心,吸收了Struts1的优点,因此,可以认为Struts2是Struts1和Webwork结合的产物. 一 ...

  4. Struts1、Struts2及SpringMVC对比

    Struts2其实并不是一个陌生的Web框架,Struts2是以Webwork的设计思想为核心,吸收了Struts1的优点,因此,可以认为Struts2是Struts1和Webwork结合的产物. 简 ...

  5. Struts1与Struts2对比分析

    Struts2其实并不是一个陌生的Web框架,Struts2是以Webwork的设计思想为核心,吸收了Struts1的优点,因此,可以认为Struts2是Struts1和Webwork结合的产物. 简 ...

  6. Struts2与Struts1的对比学习(一)

    写在前面: Struts1官方已经停止更新,现在用的也比较少,但是了解Struts1可以帮助我们更好的理解Struts2. 我们不能简单的把Struts2理解为Struts1的升级,甚至可以说这样理解 ...

  7. 【java毕业设计】基于java+SSH+jsp的酒水销售系统设计与实现(毕业论文+程序源码)——酒水销售系统

    基于java+SSH+jsp的酒水销售系统设计与实现(毕业论文+程序源码) 大家好,今天给大家介绍基于java+SSH+jsp的酒水销售系统设计与实现,文章末尾附有本毕业设计的论文和源码下载地址哦. ...

  8. 洋酒销售系统的设计与实现

    源码及论文下载: 源码及论文下载:http://www.byamd.xyz/tag/java/ 摘 要 随着洋酒与中国市场的相互适应以及电子商务和网上商店的普及,洋酒类商品的网上展示与订购逐渐成为主流 ...

  9. 【java毕业设计】基于JAVA+JSP+strust2的电子政务网设计与实现(毕业论文+程序源码)——电子政务网

    基于JAVA+JSP+strust2的电子政务网设计与实现(毕业论文+程序源码) 大家好,今天给大家介绍基于JAVA+JSP+strust2的电子政务网设计与实现,文章末尾附有本毕业设计的论文和源码下 ...

最新文章

  1. 【经典课程】图灵奖得主LeCun亲授,深度学习课程在线发布
  2. ncnn源码编译安装
  3. 厉害了黑科技,动态安全下的防拖库原来可以这么简单!
  4. 使用C# 探索 ML.NET 中的不同机器学习任务
  5. 报错The sandbox is not in sync with the Podfile.lock
  6. 【牛客 - 303D第十五届浙江大学宁波理工学院程序设计大赛(同步赛)】Campaign(二进制枚举,位运算,暴力,思维)
  7. 为什么不敢和别人竞争_净空法师开示:学老实,在社会上不能跟人竞争吗? - 如是我闻佛教网...
  8. Springboot Bean Validation校验框架
  9. qt运行时间越长越卡_Qt开源作品22-运行时间记录类
  10. htt:// ************不在以下 request 合法域名列表中,请参考文档:******************************
  11. Web Api 内部数据思考 和 利用http缓存优化 Api
  12. js的浅拷贝与深拷贝
  13. 【图像检索】基于matlab GUI KNN图像检索【含Matlab源码 267期】
  14. python 求极值
  15. 高速下载百度网盘资料(Tampermonkey+百度网盘直链下载助手+xdown)
  16. 如何判断网站被黑?网站被黑如何应对?如何防止网站被黑?
  17. RSTP Proposal-Agreement
  18. AudioToolbox使用方法总结
  19. 2014年10月30日 1、完成AHC合并部分,调试通过代码
  20. 2016年十大黑客工具

热门文章

  1. 情人节程序员用HTML网页表白【七夕告白(520气球)】 HTML5七夕情人节表白网页源码 HTML+CSS+JavaScript
  2. 基于深度学习的VQA(视觉问答)技术
  3. JSP+ssm计算机毕业设计高速公路管理系统设计与实现e6hx6【源码、数据库、LW、部署】
  4. Windows Server 2012 R2下补丁服务器部署与配置
  5. C#windows实验器材管理系统,耗材管理系统
  6. Java实现TCP/IP的ping连通性
  7. Nginx目录穿越漏洞
  8. Matlab滤波器的设计
  9. 安全工程师转正面试题
  10. 开题报告:基于java电子书阅读系统 毕业设计论文开题报告模板