I am using this link to study Spring MVC. As described dispatcher-servlet is at the top handling all incoming requests.
It also describes that there is a HandlerMapping and a Controller. However, in the source code, only Controller is used. Which is HandlerMapping then? Is is not a separate file?
Or is it present in some other complex scenario?
When no handler mapping is explicitly specified in configuation,
BeanNameUrlHandlerMappingis created and used by default.From the article you linked:
“By default the
DispatcherServletuses theBeanNameUrlHandlerMappingto map the incoming request. TheBeanNameUrlHandlerMappinguses the bean name as the URL pattern. SinceBeanNameUrlHandlerMappingis used by default, you need not do any seperate configuration for this.”