The implementation principle of struts interceptor

Source: Internet
Author: User

Figure 1:

The

comes from the STRUTS2 official site, which is the overall structure of struts 2.  
The processing of a request in the STRUTS2 framework is roughly divided into the following steps  
1 Client Initializes a request to a servlet container (for example, Tomcat)  
2 This request passes through a series of filters (filter) with an optional filter called Actioncontextcleanup, which is useful for integration of Struts2 and other frameworks , for example: Sitemesh Plugin)  
3 then Filterdispatcher is called, Filterdispatcher asked Actionmapper to decide whether or not to call a action ,
4 If Actionmapper decides that an action needs to be called, Filterdispatcher the processing of the request to actionproxy 
5 actionproxy asks the configuration file of the Framework via Config Manager, Locate the action class   that you want to call;
6 Actionproxy Create an instance of Actioninvocation.   the
7 Actioninvocation instance is invoked using a naming pattern that involves a call to the relevant interceptor (Intercepter) before and after the procedure that invokes the action.  
8 Once the action is executed, Actioninvocation is responsible for finding the corresponding return result based on the configuration in Struts.xml. The return result is usually (but not always, possibly another action chain) a JSP or freemarker template that needs to be represented. The tags inherited in the STRUTS2 framework can be used in the representation process. In this process, it is necessary to involve actionmapper 

all objects in the above procedure (Action,results,interceptors, etc.) are created through Objectfactory.

The implementation principle of struts interceptor

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.