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的更多相关文章

  1. Apache Struts 2 Documentation Core Developers Guide

    http://struts.apache.org/docs/core-developers-guide.html

  2. org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter与org.apache.struts.dispatcher.FilterDispatcher是什么区别?

    org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter与org.apache.struts.dispatcher.F ...

  3. Apache Struts ClassLoader操作漏洞

    漏洞版本: Apache Struts 2.x 漏洞描述: CVE ID:CVE-2014-0094 Struts2 是第二代基于Model-View-Controller (MVC)模型的java企 ...

  4. Apache Struts 跨站脚本漏洞

    漏洞名称: Apache Struts 跨站脚本漏洞 CNNVD编号: CNNVD-201311-010 发布时间: 2013-11-04 更新时间: 2013-11-04 危害等级:    漏洞类型 ...

  5. Apache Struts 安全措施绕过漏洞(CVE-2013-4310)

    漏洞版本: Apache Group Struts < 2.3.15.2 漏洞描述: BUGTRAQ ID: 62584 CVE(CAN) ID: CVE-2013-4310 Struts2 是 ...

  6. Apache Struts 远程代码执行漏洞(CVE-2013-4316)

    漏洞版本: Apache Group Struts < 2.3.15.2 漏洞描述: BUGTRAQ ID: 62587 CVE(CAN) ID: CVE-2013-4316 Struts2 是 ...

  7. Apache Struts 多个开放重定向漏洞(CVE-2013-2248)

    漏洞版本: Struts < 2.3.15.1 漏洞描述: BUGTRAQ ID: 61196 CVE(CAN) ID: CVE-2013-2248 Struts2 是第二代基于Model-Vi ...

  8. java org.apache.struts.taglib.html.BEAN 没有找到

    index.jsp <body> <a href="login2.do">登陆(struts标签)</a><br> </bod ...

  9. 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的项目文件如下: ...

随机推荐

  1. InitComponent的使用

    网页中的数据,有些是不在网页上改变的,像一些个人信息,比如:头像,当前用户名,友情链接等等,每次请求该页面都要重新加载,这样很消耗服务器资源,会降低服务器的性能,这个时候我们可以把这些不变的信息,统一 ...

  2. 在Eclipes中查看源代码和大纲快速定位

    1 在Eclipes中查看源代码,快捷键使用clrl+光标,选择你要查看的方法和属性查看源代码.例如你想看StringBuilder这个类源代码 StringBuilder allow = new S ...

  3. How a non-windowed component can receive messages from Windows

    Why do it? Sometimes we need a non-windowed component (i.e. one that isn't derived fromTWinControl) ...

  4. scala 基本语法

    1.对于一个二元数组,键值对(k,v) 用map的时候,要取第一个或者第二个元素,用 _1 或者 _2表示. scala> words.take(2)res40: Array[(String, ...

  5. .Spark Streaming(上)--实时流计算Spark Streaming原理介

    Spark入门实战系列--7.Spark Streaming(上)--实时流计算Spark Streaming原理介绍 http://www.cnblogs.com/shishanyuan/p/474 ...

  6. spark性能调优 数据倾斜 内存不足 oom解决办法

    [重要] Spark性能调优——扩展篇 : http://blog.csdn.net/zdy0_2004/article/details/51705043

  7. oracle与DB2

    1.体系结构,DB2的实例和数据库分开的做法,我个人还是比较喜欢的,因为实例可以创建多个,数据库的恢复直接恢复到实例下就可以了,相对ORACLE简单多了. 2.管理工具,DB2的管理工具做得太简陋了, ...

  8. Linux 软件 安装到 /usr,/usr/local/ 还是 /opt 目录

    Linux 的软件安装目录是也是有讲究的,理解这一点,在对系统管理是有益的 /usr:系统级的目录,可以理解为C:/Windows/,/usr/lib理解为C:/Windows/System32./u ...

  9. easyUIDataGrid分页

    package com.cn.eport.util; import java.util.List; /** * * * @author zh * */ public class DataGrid im ...

  10. 关于number...的精度问题

    一 当数字的精度被定为number(3,2)时, 这时他能输入的数字整数部分只能是3-2=1位, 小数位如果不够会用0补齐, 超出的四舍五入保留3位小数. SQL> insert into t_ ...