Struts2 is based on WebWork2 web technology and MVC Model 2 Architecture.
Its extensible and light weight framework for development of web applications.
Model represents the business data and Actions act as model components in Struts2.
It can use persistence technologies such as JDBC, EJB and Hibernate.
View is responsible for presenting data to the end user. Struts2 supports to represent
the same data model using different view technologies such as JSP, Tiles, Velocity and Freemarker.
It provides a result type supporting each view technology.
The Controller acts as a mediator between the View and the Model components.
It takes the appropriate action based on request. Struts2 Dispatcher Filter
acts as a controller component and starts the request processing life cycle.
Controller uses navigation rules defined in struts.xml to invoke appropriate action.
Request Processing Lifecycle
The client makes a request to the web application. The client could be a web browser or HTTPClient program
FilterDispatcher configured in web.xml intercepts the request and determines the list of
inteceptors and action to be executed from struts.xml by matching URL pattern.
The request is passed through list of interceptors identified in the previous step.
Interceptors can stop the request processing chain and return the result string if required.
The action gets executed after all the interceptors are executed. It then returns a
result string which determines the view to be rendered.
The Controller uses the result string returned from action to choose the view from struts.xml.
It then builds the response and renders back to the client.