Architecture of struts 1.x application – Struts Tutorial

Architecture of Struts 1.x Application

  • In the Architecture of struts 1.x application business logic is placed directly in the Action class so it comes under model layer resource.
  1. Programmer deploys Struts application web server/application server. During this process server performs some initial operation on the deployed struts application.
  2. End user launches web page or form page of Struts application on browser window.
  3. End user submits request from form page having form data.
  4. The controller servlet called ActionServlet traps & takes the request based on its configuration done in web .xml file and also reads form data from form page.
  5. ActionServlet uses Struts configure file entries to generate integration logic & to decide form bean, Struts Action class to process the request.
  6. ActionServlet  creates / locates form bean class object and writes the received form data to it.
  7. The form validation logic of form bean class validates the form data.
  8. ActionServlet creates /locates struts action class object.
  9. ActionServlet calls execute method of struts Action class.
  10. This execute method processes the request by using business logic and sends the result & control to ActionServlet.
  11. ActionServlet uses Action forward configures of struts configure File to decide the result page of Action class.
  12. ActionServlet passes the result control to result page.
  13. Presentation logic of result page formats the result the result and sends response to browser window as dynamic webpage.

Note:- form bean class object is visible in the execute method of struts Action class as parameter value.

Struts software created by using multiple technologies so to use these technologies effectively the creators of struts software have implemented some design patterns while creating struts software.

Some important design patterns are:-

1)      Singleton design pattern (Action servlet)

2)      Front controller (Action Servlet)

3)      Abstract controller (Request Dispatcher)

4)      IOC (inversion of control) (Action Servlet form bean) Dependency injection

5)      V.O.class / D.T.O class (form Bean class)

6)      MVC2 (Whole struts APP)

Related Projects

Leave a Reply

Your email address will not be published. Required fields are marked *