150 CHAPTER 3: Best Practices in Java EE Web Development
Figure 3-10 shows the structure of the Front Controller pattern.
Client
Front
Controller
Request
Delegates requestDispatches request
Servlet Container
Dispatcher View
Figure 3-10. Front Controller class diagram
The components of the Front Controller pattern are as follows:
Controller
Dispatcher
View
Controller
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 errors
Dispatcher
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.