From a high level, Struts2 is a pull-MVC (or MVC2) framework. The Model-View-Controller pattern in Struts2 is implemented with the following five core components:
Struts 2 is slightly different from a traditional MVC framework, where the action takes the role of the model rather than the controller, although there is some overlap. The above diagram depicts the Model, View and Controller to the Struts2 high level architecture. The controller is implemented with a Struts2 dispatch servlet filter as well as interceptors, this model is implemented with actions, and the view is a STRUTS 2 – ARCHITECTURE combination of result types and results. The value stack and OGNL provides common thread, linking and enabling integration between the other components. Apart from the above components, there will be a lot of information that relates to configuration. Configuration for the web application, as well as configuration for actions, interceptors, results, etc. This is the architectural overview of the Struts 2 MVC pattern. We will go through each component in more detail in the subsequent chapters. Request Life Cycle Based on the above diagram, you can understand the work flow through user's request life cycle in Struts 2 as follows:
|