Spring MVC creates some default out of the box Objects such as HandlerMapping, ViewResolver etc.
Where is the configuration file in which these beans which are created by default are configured? (I am not talking about the config file which we provide).
I am asking where is the default configuration stored which Spring uses to create default out of the box implementations of above mentioned objects?
I am assuming you are asking about the default handlerMapping, validators that are created by Spring MVC when you specify something like
<mvc:annotation-driven>.This is basically a custom Spring namespace called mvc, this custom namespace is handled by MvcNamespaceHandler. If you look at the source of this class, this is some of the relevant content:
This is essentially registering a series of parsers based on which tag is found, so above it is registering a AnnotationDrivenBeanDefinitionParser for
annotation-driventag ofmvcnamespace.It is here that the defaults are registered.
For eg, the handlerMapping is registered this way:
Along the same lines other components are registered. So in essence, the configuration is in the different AnnotationDrivenBeanDefinitionParsers via code and not in any specific configuration file.