博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
struts原理图
阅读量:5013 次
发布时间:2019-06-12

本文共 2056 字,大约阅读时间需要 6 分钟。

n 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 . Next, the required FilterDispatcher is called, which in turn consults the  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  manager (initialized from the  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 ) involves a template written in  or  to be rendered. While rendering, the templates can use the  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, , , and so forth) are created by an . 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 .

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.

 https://cwiki.apache.org/confluence/display/WW/The+Struts+2+Request+Flow

 

转载于:https://www.cnblogs.com/dzhou/p/10102344.html

你可能感兴趣的文章
ajax请求
查看>>
js学习总结----DOM增删改和应用
查看>>
希尔伯特矩阵(Hilbert matrix)
查看>>
(20)sopel算法
查看>>
学习总结 javascript 闭包
查看>>
实验吧一个小坑注入
查看>>
【 D3.js 高级系列 — 8.0 】 打标
查看>>
Mac必备软件推荐
查看>>
Android Gson深入分析
查看>>
display:flow-root
查看>>
判读字符串是否为空的全局宏-分享
查看>>
iOS中Block的基础用法
查看>>
mac 终端 使用ftp命令
查看>>
22-reverseString-Leetcode
查看>>
Centos 开机自动联网
查看>>
cocos2dx使用lua和protobuf
查看>>
HDOJ 5630 Rikka with Chess
查看>>
netcore2.1 在后台运行一个任务
查看>>
PostgreSQL pg_hba.conf 文件简析
查看>>
android o logcat read: unexpected EOF!
查看>>