1. inherit the AbstractInterceptor class or implement the interceptor interface. Because AbstractInterceptor is the implementation class of interceptor, the general methods in the interface are implemented, but they are used to inherit AbstractInterceptor. Just like the Action in struts2 inherits ActionSupport and does not implement the Action interface. 2. It is more feasible to inherit the AbstractInterceptor class. Invocation. invoke (); indicates that the execute () method of the Action is executed after the method is executed, or the next interceptor invocation is executed. getAction (); this method can be forcibly converted to the class type of Action. 3. Method Interceptor: inherits the MethodFilterInterceptor class and overwrites doIntercept () method MethodFilerInterceptor two parameters used in method filtering execludeMethods: this parameter specifies the list of methods that the interceptor rejects. Multiple methods are separated by commas (,) and this parameter is specified, the interceptor does not intercept methods in the specified list, that is, the so-called blacklist includeMethods: this parameter specifies the list of methods to intercept by the Interceptor. If a parameter is specified, the specified Action will be intercepted before execution, whitelist. After the custom interceptor is defined, you must use the custom interceptor in struts. in xml document 1, define interceptor 1 <package...> 2 <interceptors> 3 <interceptor name = "myinterceptor" class = ".... "> 4 </interceptor> 5 </interceptors> 6 </package> 2. Use interceptor 1 in action <action ......> 2 <result...> </result> 3 <interceptor-ref name = "defaultStack"> </interceptor-ref> 4 <interceptor-ref name = "myinterceptor"> </interceptor-ref> 5 </action> mainly: we can see that the reference of the default interceptor should be configured for the action of the custom interceptor, because the default interceptor contains the reading of parameters, session management, and other functions.