Handler mapping
You have learned that DispatcherServlet
is the thing that dispatches the request to the handler methods based on the request mapping, but in order to interpret the mappings defined in a request mapping, DispatcherServlet
needs a HandlerMapping
(org.springframework.web.servlet.HandlerMapping
) implementation. DispatcherServlet
consults with one or more HandlerMapping
implementations to know which 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 able to inspect the request and come up with an appropriate Controller. Spring MVC provides many HandlerMapping
implementations, ...
Get Spring MVC Beginner’s Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.