Struts 2架构图以及说明
时间:2011-03-22 来源:Jolly-zhang
此文件copy自struts2 reference.个人认为这个图对理解struts2非常有帮助,所以就拿来放到自己的博客上了。
In 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 SiteMesh Plugin . Next, the required FilterDispatcher is called, which in turn consults theActionMapper 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 frameworkConfiguration Files manager (initialized from the struts.xml 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 Action Chaining ) involves a template written in JSP or FreeMarker to be rendered. While rendering, the templates can use the Struts Tags provided by the framework. Some of those components will work with the ActionMapper to render proper URLs for additional requests.