一个请求在Struts2框架中的处理流程

1.客户端向Servlet容器发起一个请求,将请求封装为HttpServletRequest对象。

2.HttpServletRequest首先经过web.xml中配置的struts2的过滤器,以及struts2内置的一些过滤器。

3.接着FilterDispatcher(现已过时)被调用,FilterDispatcher询问ActionMapper来决定这个请是否需要调用某个Action。

4.如果ActionMapper决定需要调用某个Action,FilterDispatcher把请求的处理交给ActionProxy 。

5.ActionProxy通过Configuration Manager询问框架的配置文件struts.xml,找到需要调用的Action类。

6.ActionProxy创建一个ActionInvocation的实例。

7.ActionInvocation实例使用命名模式来调用,在调用Action的过程前后,涉及到相关拦截器(Intercepter)的调用。

 

posted @ 2016-08-18 00:53  洞拐洞拐  阅读(306)  评论(0编辑  收藏  举报