Home » Java Basics » 10 - Java - Database and XML Input
10

The Struts Framework

The use of the MVC design pattern

The Struts framework uses the MVC design pattern. The MVC design pattern separates GUI based applications into an underlying model, a View. The display of the model that the user sees and interacts with, and a controller that mediates between the two (i.e. fetches data from the model, inserts it at appropriate places in the view etc.) and serves as an interface. The Model represents, or encapsulates, an application's business logic or state. Instead of mixing the MVC components in a rather untidy mash like servlets and JSPs sometimes do, the struts framework offers a way of separating the model from the view and the controller by offering the ActionServlet and ActionMapping classes. Each model comes with a handler, the handler acts as an adapter between the request and the Model. The Controller may delegate HTTP requests to appropriate handlers.