Struts 2 isn’t just a new release of the older Struts 1 framework. It is a completely new framework, based on the esteemed OpenSymphony WebWork framework.
Since we’ve stressed that Struts 2 is truly a new framework, you might be wondering how hard it will be to move from Struts 1 to Struts 2. There are some things to learn, interceptors and OGNL in particular.
The role of the controller is played by the Struts 2 FilterDispatcher. This important object is a servlet filter that inspects each incoming request to determine which Struts 2 action should handle the request.
it’s easy to see that the model is implemented by the Struts 2 action component. But what exactly is the model? I find the model the most nebulous of the MVC triad.
INTERCEPTORS
most every
action will have a stack of interceptors associated with it. These interceptors are invoked both before and after the action, though we should note that they actually fire after the result has executed. Interceptors don’t necessarily have to do something both times they fire, but they do have the opportunity. Some interceptors only do work
before the action has been executed, and others only do work afterward.
THE VALUESTACK AND OGNL
The data in the ValueStack follows the request processing through all phases; it slices through the whole length of the framework. It can do this because it is stored in a ThreadLocal context called the ActionContext.