If you look at the Java EE FrontController sequence diagram, the Controller delegates the request to Dispatcher and the document says that:
A dispatcher is responsible for view management and navigation, managing the choice of the next view to present to the user, and providing the mechanism for vectoring control to this resource.
In Spring MVC, the DispatcherServlet
acts as FrontController (as mentioned in Book by Craig Walls), and this Servlet delegates the request to other controllers that in turn calls appropriate Service class (for processing the request) and then returns an instance of ModelAndView
to DispatcherServlet
again.
So roughly this is how request usually travels:
Client -> DispatcherServlet -> Controller -> Service -> DAO
If you compare this flow with Java EE FrontController pattern sequence diagram, it appears that DispatcherServlet
is not true FrontController.
What do you say about this?