Struts 2 Architecture and Flow


The architecture and stream of struts 2 application, is joined with numerous components , for example, Controller, ActionProxy, ActionMapper, Configuration Manager, ActionInvocation, Inerceptor, Action, Result and so on.

Here, we will comprehend the struts stream by 2 ways:

  1. struts 2 essential flow
  2. struts 2 standard design and stream given by apache struts

Struts 2 essential flow

Let's attempt to comprehend the fundamental progression of struts 2 application by this basic figure:

struts 2 basic flow
  1. User sends a request for the action
  2. Controller invokes the ActionInvocation
  3. ActionInvocation invokes every interceptor and action
  4. A result is generated
  5. The result is sent back to the ActionInvocation
  6. A HttpServletResponse is generated
  7. Response is sent to the user

Struts 2 standard stream (Struts 2 architecture)

Let's understand to comprehend the standard design of struts 2 application by this basic figure:

struts 2 architecture
  1. User sends a request for the action
  2. Container maps the request in the web.xml record and gets the class name of controller.
  3. Container invokes the controller (StrutsPrepareAndExecuteFilter or FilterDispatcher). Since struts2.1, it is StrutsPrepareAndExecuteFilter. Before 2.1 it was FilterDispatcher.
  4. Controller gets the data for the activity from the ActionMapper
  5. Controller invokes the ActionProxy
  6. ActionProxy gets the data of activity and interceptor stack from the arrangement chief which gets the data from the struts.xml file.
  7. ActionProxy advances the request to the ActionInvocation
  8. ActionInvocation invokes every interceptor and action
  9. A result is generated
  10. The result is sent back to the ActionInvocation
  11. A HttpServletResponse is generated
  12. Response is sent to the user





javacodegeeks is optimized for learning.© javacodegeeks .
All Right Reserved and you agree to have read and accepted our term and condition