×
☰ See All Chapters

Spring Handler Mapping

org.springframework.web.servlet.HandlerMapping is an handler mapping interface which defines the controller class that is to be executed when users hit a URL on browser. So, the work of Handler Mapping is to find out the controller bean in respect to a URL. Hence Handler Mapping can also be called as URL handlers. There are certain HandlerMapping Implementations, each provides built in navigation strategies as determining the handler based on the requested URL. We can also define custom navigation strategies by writing a class implementing HandlerMapping interface. Spring built-in HandlerMapping implementations are:

  1. BeanNameUrlHandlerMapping 

  2. SimpleUrlHandlerMapping 

  3. ControllerClassHandlerMapping 

  4. CommonsPathMapHandlerMapping 

We will learn these in detail in coming chapters.


All Chapters
Author