模块装配@EnableWebMvc
```
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Documented
@Import(DelegatingWebMvcConfiguration.class)
public @interface EnableWebMvc {}
```
DelegatingWebMvcConfiguration继承WebMvcConfigurationSupport
WebMvcConfigurationSupport初始化了很多bean
例如:RequestMappingHandlerMapping
/**
* Return a {@link RequestMappingHandlerMapping} ordered at 0 for mapping
* requests to annotated controllers.
*/
@Bean
public RequestMappingHandlerMapping requestMappingHandlerMapping() {
RequestMappingHandlerMapping mapping = createRequestMappingHandlerMapping();
。。。
return mapping;
}
网友评论