We have learned that
DispatcherServlet is the one that dispatches the request to the handler methods based on the request mapping; however, in order to interpret the mappings defined in the request mapping,
DispatcherServlet needs a
HandlerMapping implementation (
DispatcherServlet consults with one or more
HandlerMapping implementations to find out which
controller (handler) can handle the request. So,
HandlerMapping determines which controller to call.
HandlerMapping interface provides the abstraction for mapping requests to handlers. The
HandlerMapping implementations are capable of inspecting the request and coming up with an appropriate controller. Spring MVC provides ...