Struts2 source code analysis class call sequence diagram



 

 

1. The client initiates a request to a servlet container (such as Tomcat);

 

2. The request goes through a filter (StrutsPrepareAndExecuteFilterFilter)

 

3. Then the Dispatcher is called, and the Dispatcher asks ActionMapping to decide whether the request needs to call an Action;

 

4. If ActionMapping decides that an Action needs to be called, the Dispatcher will hand over the processing of the request to ActionProxy;

 

5. ActionProxy asks the configuration file of the framework through the Configuration Manager to find the Action class that needs to be called;

 

6. ActionProxy creates an instance of ActionInvocation.

 

7. The ActionInvocation instance is called using the naming pattern. Before and after the process of calling the Action, it involves the invocation of the relevant interceptor (Intercepter).

 

8. Once the Action is executed, ActionInvocation is responsible for finding the corresponding return result according to the configuration in struts.xml. The returned result is usually (but not always, another Action chain) a JSP or FreeMarker template that needs to be represented. Labels inherited from the Struts2 framework can be used during presentation. ActionMapper needs to be involved in this process.

 

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326674317&siteId=291194637