Saturday, December 3, 2011

Front Controller Design pattern in java/jsp applications

Front Controller is one of the most important design pattern mostly used in web applications.
The problem:-
As you know in a web application, whenever clients send the request to the server, the server process the request, if possible make a database call, get the data from the Database or other third party systems and process the data, and send the response. Here there is different components involved, business data validation, holding the database data(model) and view process. Because of this process, there is a lack of a single point of contact for the request. Front Control design pattern is introduced. This Servlet act as a controller sitting in front of other resources. In this patter, all the request that send by different resources like browser, the mobile client, as well as Standalone apps, are handled by this servlet and delegate the request to appropriate web resources. It is the entry point for the request sent by the browser.
ActionServlet is the front controller for Struts based applications DispatchServlet is the front controller for spring web MVC based applications