Spring: Developing Java Applications for the Enterprise
by Ravi Kant Soni, Amuthan Ganeshan, Rajesh RV
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, and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access