Big Picture
When you think about the request life cycle of Struts 2, the following comes to mind:
- Map URL to server side component
- Invoke associated action
- Returning a response
Struts adds a special sauce by allowing you to specify a named stack of interceptors to be invoked before and after the invocation of your action. This list of interceptors can be reused or all or a subset of your actions and can handle any cross-cutting concern associated with a request.
If you have thought about the way aspect-oriented programming works, this should be a natural concept. If not, imagine the code you would have to add to all your actions in order to guarantee that some particular set of activities was performed in a uniform and consistent fashion. The following graphic depicts this life cycle:
