Class DelegatingWebMvcConfiguration
- All Implemented Interfaces:
- Aware,- ApplicationContextAware,- ServletContextAware
WebMvcConfigurationSupport that detects and delegates
 to all beans of type WebMvcConfigurer allowing them to customize the
 configuration provided by WebMvcConfigurationSupport. This is the
 class actually imported by @EnableWebMvc.- Since:
- 3.1
- Author:
- Rossen Stoyanchev
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidaddArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) Add customHandlerMethodArgumentResolversto use in addition to the ones registered by default.protected voidaddCorsMappings(CorsRegistry registry) Override this method to configure cross origin requests processing.protected voidaddFormatters(FormatterRegistry registry) Override this method to add customConverterand/orFormatterdelegates to the commonFormattingConversionService.protected voidaddInterceptors(InterceptorRegistry registry) Override this method to add Spring MVC interceptors for pre- and post-processing of controller invocation.protected voidaddResourceHandlers(ResourceHandlerRegistry registry) Override this method to add resource handlers for serving static resources.protected voidaddReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers) Add customHandlerMethodReturnValueHandlersin addition to the ones registered by default.protected voidaddViewControllers(ViewControllerRegistry registry) Override this method to add view controllers.protected voidconfigureAsyncSupport(AsyncSupportConfigurer configurer) Override this method to configure asynchronous request processing options.protected voidOverride this method to configure content negotiation.protected voidOverride this method to configure "default" Servlet handling.protected voidconfigureHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers) Override this method to configure the list ofHandlerExceptionResolversto use.protected voidconfigureMessageConverters(List<HttpMessageConverter<?>> converters) Override this method to add customHttpMessageConvertersto use with theRequestMappingHandlerAdapterand theExceptionHandlerExceptionResolver.protected voidconfigurePathMatch(PathMatchConfigurer configurer) Override this method to configure path matching options.protected voidconfigureViewResolvers(ViewResolverRegistry registry) Override this method to configure view resolution.protected voidextendHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers) Override this method to extend or modify the list ofHandlerExceptionResolversafter it has been configured.protected voidextendMessageConverters(List<HttpMessageConverter<?>> converters) Override this method to extend or modify the list of converters after it has been configured.protected MessageCodesResolverOverride this method to provide a customMessageCodesResolver.protected ValidatorOverride this method to provide a customValidator.voidsetConfigurers(List<WebMvcConfigurer> configurers) Methods inherited from class org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupportaddDefaultHandlerExceptionResolvers, addDefaultHttpMessageConverters, beanNameHandlerMapping, createExceptionHandlerExceptionResolver, createRequestMappingHandlerAdapter, createRequestMappingHandlerMapping, defaultServletHandlerMapping, flashMapManager, getApplicationContext, getArgumentResolvers, getAsyncSupportConfigurer, getConfigurableWebBindingInitializer, getCorsConfigurations, getDefaultMediaTypes, getInterceptors, getMessageConverters, getPathMatchConfigurer, getReturnValueHandlers, getServletContext, handlerExceptionResolver, handlerFunctionAdapter, httpRequestHandlerAdapter, localeResolver, mvcContentNegotiationManager, mvcConversionService, mvcHandlerMappingIntrospector, mvcPathMatcher, mvcPatternParser, mvcResourceUrlProvider, mvcUriComponentsContributor, mvcUrlPathHelper, mvcValidator, mvcViewResolver, requestMappingHandlerAdapter, requestMappingHandlerMapping, resourceHandlerMapping, routerFunctionMapping, setApplicationContext, setServletContext, simpleControllerHandlerAdapter, themeResolver, viewControllerHandlerMapping, viewNameTranslator
- 
Constructor Details- 
DelegatingWebMvcConfigurationpublic DelegatingWebMvcConfiguration()
 
- 
- 
Method Details- 
setConfigurers
- 
configurePathMatchDescription copied from class:WebMvcConfigurationSupportOverride this method to configure path matching options.- Overrides:
- configurePathMatchin class- WebMvcConfigurationSupport
- See Also:
 
- 
configureContentNegotiationDescription copied from class:WebMvcConfigurationSupportOverride this method to configure content negotiation.- Overrides:
- configureContentNegotiationin class- WebMvcConfigurationSupport
- See Also:
 
- 
configureAsyncSupportDescription copied from class:WebMvcConfigurationSupportOverride this method to configure asynchronous request processing options.- Overrides:
- configureAsyncSupportin class- WebMvcConfigurationSupport
- See Also:
 
- 
configureDefaultServletHandlingDescription copied from class:WebMvcConfigurationSupportOverride this method to configure "default" Servlet handling.- Overrides:
- configureDefaultServletHandlingin class- WebMvcConfigurationSupport
- See Also:
 
- 
addFormattersDescription copied from class:WebMvcConfigurationSupportOverride this method to add customConverterand/orFormatterdelegates to the commonFormattingConversionService.- Overrides:
- addFormattersin class- WebMvcConfigurationSupport
- See Also:
 
- 
addInterceptorsDescription copied from class:WebMvcConfigurationSupportOverride this method to add Spring MVC interceptors for pre- and post-processing of controller invocation.- Overrides:
- addInterceptorsin class- WebMvcConfigurationSupport
- See Also:
 
- 
addResourceHandlersDescription copied from class:WebMvcConfigurationSupportOverride this method to add resource handlers for serving static resources.- Overrides:
- addResourceHandlersin class- WebMvcConfigurationSupport
- See Also:
 
- 
addCorsMappingsDescription copied from class:WebMvcConfigurationSupportOverride this method to configure cross origin requests processing.- Overrides:
- addCorsMappingsin class- WebMvcConfigurationSupport
- See Also:
 
- 
addViewControllersDescription copied from class:WebMvcConfigurationSupportOverride this method to add view controllers.- Overrides:
- addViewControllersin class- WebMvcConfigurationSupport
- See Also:
 
- 
configureViewResolversDescription copied from class:WebMvcConfigurationSupportOverride this method to configure view resolution.- Overrides:
- configureViewResolversin class- WebMvcConfigurationSupport
- See Also:
 
- 
addArgumentResolversDescription copied from class:WebMvcConfigurationSupportAdd customHandlerMethodArgumentResolversto use in addition to the ones registered by default.Custom argument resolvers are invoked before built-in resolvers except for those that rely on the presence of annotations (e.g. @RequestParameter,@PathVariable, etc). The latter can be customized by configuring theRequestMappingHandlerAdapterdirectly.- Overrides:
- addArgumentResolversin class- WebMvcConfigurationSupport
- Parameters:
- argumentResolvers- the list of custom converters (initially an empty list)
 
- 
addReturnValueHandlersDescription copied from class:WebMvcConfigurationSupportAdd customHandlerMethodReturnValueHandlersin addition to the ones registered by default.Custom return value handlers are invoked before built-in ones except for those that rely on the presence of annotations (e.g. @ResponseBody,@ModelAttribute, etc). The latter can be customized by configuring theRequestMappingHandlerAdapterdirectly.- Overrides:
- addReturnValueHandlersin class- WebMvcConfigurationSupport
- Parameters:
- returnValueHandlers- the list of custom handlers (initially an empty list)
 
- 
configureMessageConvertersDescription copied from class:WebMvcConfigurationSupportOverride this method to add customHttpMessageConvertersto use with theRequestMappingHandlerAdapterand theExceptionHandlerExceptionResolver.Adding converters to the list turns off the default converters that would otherwise be registered by default. Also see WebMvcConfigurationSupport.addDefaultHttpMessageConverters(java.util.List<org.springframework.http.converter.HttpMessageConverter<?>>)for adding default message converters.- Overrides:
- configureMessageConvertersin class- WebMvcConfigurationSupport
- Parameters:
- converters- a list to add message converters to (initially an empty list)
 
- 
extendMessageConvertersDescription copied from class:WebMvcConfigurationSupportOverride this method to extend or modify the list of converters after it has been configured. This may be useful for example to allow default converters to be registered and then insert a custom converter through this method.- Overrides:
- extendMessageConvertersin class- WebMvcConfigurationSupport
- Parameters:
- converters- the list of configured converters to extend
 
- 
configureHandlerExceptionResolversprotected void configureHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers) Description copied from class:WebMvcConfigurationSupportOverride this method to configure the list ofHandlerExceptionResolversto use.Adding resolvers to the list turns off the default resolvers that would otherwise be registered by default. Also see WebMvcConfigurationSupport.addDefaultHandlerExceptionResolvers(java.util.List<org.springframework.web.servlet.HandlerExceptionResolver>, org.springframework.web.accept.ContentNegotiationManager)that can be used to add the default exception resolvers.- Overrides:
- configureHandlerExceptionResolversin class- WebMvcConfigurationSupport
- Parameters:
- exceptionResolvers- a list to add exception resolvers to (initially an empty list)
 
- 
extendHandlerExceptionResolversDescription copied from class:WebMvcConfigurationSupportOverride this method to extend or modify the list ofHandlerExceptionResolversafter it has been configured.This may be useful for example to allow default resolvers to be registered and then insert a custom one through this method. - Overrides:
- extendHandlerExceptionResolversin class- WebMvcConfigurationSupport
- Parameters:
- exceptionResolvers- the list of configured resolvers to extend.
 
- 
getValidatorDescription copied from class:WebMvcConfigurationSupportOverride this method to provide a customValidator.- Overrides:
- getValidatorin class- WebMvcConfigurationSupport
 
- 
getMessageCodesResolverDescription copied from class:WebMvcConfigurationSupportOverride this method to provide a customMessageCodesResolver.- Overrides:
- getMessageCodesResolverin class- WebMvcConfigurationSupport
 
 
-