I have never been very clear about the struts2 custom Interceptor (intercepter). I have studied it carefully today and finally understood it. The record's summary of the interceptor is as follows:
1: The Role of a custom interceptor is generally to achieve more system permission control;
2: The implementation of the custom interceptor can implement the intercepter interface, inherit the abstractinterceptor class, and override its intercept method;
3: permission management usage: first, obtain the login user from the session in the intercepter () method to determine whether the user has the permission to access the corresponding action, if you have the following permissions:
String result = invocation. Invoke ();
Return result;
Note that the returned result can also be abbreviated as return invocation. Invoke ();
Why is this returned? The answer is to call other intercepter for normal return (I am not very clear here)
When you determine that the user does not have the corresponding permission to access the corresponding method of the action to be accessed, you can directly return a string corresponding to the result set: for example, return "error ";
Find the corresponding result set in the corresponding result set (this is generally a global result set). If you find that you have no access permission, you do not need to call: Invocation. invoke.
Struts2 intercepter notes