Struts2请求流程

1、客户端发送请求


2、请求先通过ActionContextCleanUp-->FilterDispatcher


3、FilterDispatcher通过ActionMapper来决定这个Request需要调用哪个Action


4、如果ActionMapper决定调用某个Action,FilterDispatcher把请求的处理交给ActionProxy,这儿已经转到它的Delegate--Dispatcher来执行


5、ActionProxy根据ActionMapping和ConfigurationManager找到需要调用的Action类


6、ActionProxy创建一个ActionInvocation的实例


7、ActionInvocation调用真正的Action,当然这涉及到相关拦截器的调用


8、Action执行完毕,ActionInvocation创建Result并返回,当然,如果要在返回之前做些什么,可以实现PreResultListener。

添加PreResultListener可以在Interceptor中实现.

你可能感兴趣的:(struts2)