Model View Controller 2 architecture

Spring Book – Chapter 12 – Spring and Struts Integration

Struts 2 Architecture

Struts 2 Framework is very extensible and elegant for the development of enterprise web application of any size. A typical request lifecycle in a Struts 2 application is as summarized below:

  1. User sends a request to the server requesting for a resource.
  2. The FilterDispatcher looks at the request and then determines the appropriate Action.
  3. Interceptors configured in the application pitch in and applies common functionalities like validation, file upload etc. to the incoming request.
  4. The action method then gets executed which actually does the real business case like storing or retrieving data from database etc.
  5. The result is then rendered as output.
  6. The response traverses through the interceptors in the reverse order in which we have a provision to do additional processing as required by your application.
  7. The control finally comes back to the servlet controller which sends the response to the browser for rendering.

The Struts 2 architecture can be pictorially represented in simple terms as shown in Figure 12-2 below.

fig12-02

Figure 12-2. High-level Struts2 Architecture

Struts 2 is a very elegant, flexible and extensible front controller framework based on many standard technologies like Java Filters, Java Beans, ResourceBundles, XML etc. The Model in Struts 2 framework can use any data access technologies like JDBC, EJB, Hibernate etc. and the View can be integrated with JSP, JTL, JSF, Jakarta Velocity Engine, Templates, PDF, XSLT etc. Figure 12-3 below shows the Struts 2 architecture bringing in the various technologies which can be used in various layers as well as depicts the complete flow of request object.

fig12-03

Figure 12-3. Detailed Struts 2Architecture

Page Visitors: 6433

The following two tabs change content below.
Tomcy John

Tomcy John

Blogger & Author at javacodebook
He is an Enterprise Java Specialist holding a degree in Engineering (B-Tech) with over 10 years of experience in several industries. He's currently working as Principal Architect at Emirates Group IT since 2005. Prior to this he has worked with Oracle Corporation and Ernst & Young. His main specialization is on various web technologies and acts as chief mentor and Architect to facilitate incorporating Spring as Corporate Standard in the organization.
Tomcy John

Latest posts by Tomcy John (see all)

4 thoughts on “Spring Book – Chapter 12 – Spring and Struts Integration

Leave a Reply

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