Show Mobile Navigation

Struts Framework uses Design Patterns

Bhanu Pratap - 8:29 AM
Every Struts application is used to use certain design patterns whether you now or not, Commonly used Command patterns is also used in Struts when we hit a request and request goes to action-servlet which eventually used Command design pattern to decide further, when we are creating ACTION class we are eventually using Adapter Design pattern.

Moreover, Every Struts application eventually using following design patterns:

  • Front Controller  Design Patterns
  • Composite View  Design Patterns
  • Adapter  Design Patterns
  • Command Design Patterns
  • Model -View-Controller  Design Patterns
  • Inversion of Control(Struts2 HTTPServletRequest through ServletRequestAware)
  • Template Method Design Pattern

Now Lets learn about each in details to know how exactly struts using these design patterns.

Front Controller  Design Patterns

- Actually, Struts is one of the fancy example for using a Front Controller pattern, the basic idea of the Front Controller pattern is that a single component handling the input and out put controller, normally a Servlet used to work as Front Controller in design pattern as in Struts ActionServlet and RequestProcessor(Used to handle HTTPRequests) which acts as single control point for the presentation tier in any web application. With the Front Controller pattern, all of the app's requests go through a single controller, which handles dispatching the request to the appropriate places.

To be concise, RequestProcessor class in Struts is responsible for implementing the FRONT CONTROLLER DESIGN, and you can enhance/extend your RequestProcessor by you own read more for What is RequestProcessor, and how to extend it?

Composite View  Design Patterns
- Composite Design Pattern is all about re-using the component to standardize the GUI of any web application or reduce the effort of change by means of changing at one place changed all over.


  1. Composite view is also describe over