150 CHAPTER 3: Best Practices in Java EE Web Development
Figure 3-10 shows the structure of the Front Controller pattern.
ClientFront
ControllerRequestDelegates requestDispatches requestServlet ContainerDispatcher ViewFigure 3-10. Front Controller class diagram
The components of the Front Controller pattern are as follows:
Controller
Dispatcher
ViewController
The controller is the initial point for handling a request and coordinates with a dispatcher component.
The controller manages the following:
Handling the request, including invoking security services such as authentication
and authorization
Delegating to the business service
Handling errorsDispatcher
The dispatcher is responsible for view management and navigation.
View
The view represents and displays information to the client.
Figure 3-11 illustrates the sequence diagram of the front controller.