Apache Struts 2 Documentation Big Picture
http://struts.apache.org/docs/big-picture.html

1. HttpServletRequest 穿越各个过滤器到达FilterDispatcher(这个已经不再使用,现在使用StrutsPrepareAndExecuteFilter)
2. 执行doFilter方法,如果模式不匹配,则进入下一个过滤链
3. 如果匹配则创建上下文(为每个请求创建实例,线程安全)
4. 根据ActionMapping 判断是否应该调用Action
5. 如果需要调用Action则把控制委派给ActionProxy
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) res;
try {
if (excludedPatterns != null && prepare.isUrlExcluded(request, excludedPatterns)) {
chain.doFilter(request, response);
} else {
prepare.setEncodingAndLocale(request, response);
prepare.createActionContext(request, response);
prepare.assignDispatcherToThread();
request = prepare.wrapRequest(request);
ActionMapping mapping = prepare.findActionMapping(request, response, true);
if (mapping == null) {
boolean handled = execute.executeStaticResourceRequest(request, response);
if (!handled) {
chain.doFilter(request, response);
}
} else {
execute.executeAction(request, response, mapping);
}
}
} finally {
prepare.cleanupRequest(request);
}
}
6. 查询配置文件
7. 创建ActionInvocation ,它与拦截器的关系如下:
/**
* Override to handle interception
*/
public abstract String intercept(ActionInvocation invocation) throws Exception;
8.调用拦截器栈、action类
9. action返回结果,有可能渲染jsp等模板,其中会发起额外的请求
10. 渲染完毕调用拦截器栈
11. HttpServletResponse通过过滤器
12. client得到响应
Apache Struts 2 Documentation Big Picture的更多相关文章
- Apache Struts 2 Documentation Core Developers Guide
http://struts.apache.org/docs/core-developers-guide.html
- org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter与org.apache.struts.dispatcher.FilterDispatcher是什么区别?
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter与org.apache.struts.dispatcher.F ...
- Apache Struts ClassLoader操作漏洞
漏洞版本: Apache Struts 2.x 漏洞描述: CVE ID:CVE-2014-0094 Struts2 是第二代基于Model-View-Controller (MVC)模型的java企 ...
- Apache Struts 跨站脚本漏洞
漏洞名称: Apache Struts 跨站脚本漏洞 CNNVD编号: CNNVD-201311-010 发布时间: 2013-11-04 更新时间: 2013-11-04 危害等级: 漏洞类型 ...
- Apache Struts 安全措施绕过漏洞(CVE-2013-4310)
漏洞版本: Apache Group Struts < 2.3.15.2 漏洞描述: BUGTRAQ ID: 62584 CVE(CAN) ID: CVE-2013-4310 Struts2 是 ...
- Apache Struts 远程代码执行漏洞(CVE-2013-4316)
漏洞版本: Apache Group Struts < 2.3.15.2 漏洞描述: BUGTRAQ ID: 62587 CVE(CAN) ID: CVE-2013-4316 Struts2 是 ...
- Apache Struts 多个开放重定向漏洞(CVE-2013-2248)
漏洞版本: Struts < 2.3.15.1 漏洞描述: BUGTRAQ ID: 61196 CVE(CAN) ID: CVE-2013-2248 Struts2 是第二代基于Model-Vi ...
- java org.apache.struts.taglib.html.BEAN 没有找到
index.jsp <body> <a href="login2.do">登陆(struts标签)</a><br> </bod ...
- org.apache.struts.chain.commands.InvalidPathException: No action config found for the specified url.
No action config found for the specified url url路径下找不到action,原因是stuts-config.xml文件配置错误. demo的项目文件如下: ...
随机推荐
- ios push local notification
UILocalNotification* localNotification = [[UILocalNotification alloc]init]; localNotification.alertB ...
- 概率论与数理统计 Q&A:
--------------------------------- 大数定律:大量样本数据的均值(样本值之和除以样本个数),近似于随机变量的期望(标准概率*样本次数).(样本(部分)趋近于总体)中心极 ...
- asp.net core in centos
CentOS 7部署ASP.NET Core应用程序 看了几篇大牛写的关于Linux部署ASP.NET Core程序的文章,今天来实战演练一下.2017年最后一个工作日,提前预祝大家伙元旦快乐.不 ...
- asp.net cors solution
I have a simple actionmethod, that returns some json. It runs on ajax.example.com. I need to access ...
- ubuntu 软件包系统已损坏 解决方法
sudo apt-get clean sudo apt-get -f install sudo apt-get upgrade
- RNN LSTM 介绍
[RNN以及LSTM的介绍和公式梳理]http://blog.csdn.net/Dark_Scope/article/details/47056361 [知乎 对比 rnn lstm 简单代码] ...
- too few PGs per OSD (20 < min 30)
ceph osd pool set replicapool pg_num 150 ceph osd pool set replicapool pgp_num 150
- Linux运维就业技术指导(八):期中架构考核
一,期中架构考核概述 1.1 架构图 1.2 架构图公司背景概述 公司是一个新兴的人脸识别高新创业公司,公司名称xxxx 老总是博士生导师,还有一个副总是研究生导师 副总同时是研发总监,负责所有的研发 ...
- Musle比对软件
下载地址:http://www.drive5.com/muscle/downloads.htm 1)运行: win+R然后输入cmd,然后cd进入muscle目录 2) 比对: muscle3.8.3 ...
- mysql与redis的区别与联系
1.mysql是关系型数据库,主要用于存放持久化数据,将数据存储在硬盘中,读取速度较慢. redis是NOSQL,即非关系型数据库,也是缓存数据库,即将数据存储在缓存中,缓存的读取速度快,能够大大的提 ...