Easy learning with example program codes

Struts 2 Architecture

Sturts 2 MVC framework contains the following core components:

  1. Actions.
  2. Interceptors.
  3. Value Stack / OGNL
  4. Result types


struts 2 architecture

Struts 2 request life cycle:

  1. When a request comes web container maps the request in the web.xml and calls the controller (FilterDispatcher).
  2. FilterDispatcher calls the ActionMapper to find an Action to be invoked.
  3. FilterDispatcher calls the ActionProxy.
  4. ActionProxy reads the information of action and interceptor stack from configuration file using configuration manager (struts.xml) and invoke the ActionInvocation.
  5. ActionInvocation calls the all interceptors one by one and then invoke the action to generate the result.
  6. action is executed ActionInvocation again calls the all interceptors in reverse order.
  7. Control is returned to the FilterDispatcher.
  8. Result is sent to the client.


Note: Struts 2 uses the ActionContext to store all the data for a request processing. ActionContext work on the ThreadLocal concept i.e. unique values for every thread. That’s why it is thread safe and we don’t have to make our action thread safe explicitly.
Next Topic: Struts 2 Configuration Files.
Previous Topic: Struts 2 overview.

Related Topics:

How to build java project using ant in eclipse?
JAXB marshalling – convert java object to xml example.
How to create pdf file in java using iText jar?
Generics class example.
OGNL in struts 2.
Hibernate One-to-One Mapping using xml.
Send inline image in email using JavaMail API.
Quartz 2 JobListener example.


Industrial Training

We offers Placement Oriented Training on Java, Spring, JSF, Hibernate, PHP, AngularJS, Angular 4, PLSQL, Oracle BI Publisher etc. We also provides Online training, please mail us at


We also provides the Development services for Website Development , Java Development, PHP Development, Android App Development etc. You can contact us on

Copyright © 2019 CodesJava Protection Status SiteMap Reference: Java Wiki