Top Description Fields Constructors Methods
org.springframework.web.servlet.config.annotation

public Class DelegatingWebMvcConfiguration

extends WebMvcConfigurationSupport
Class Inheritance
Annotations
@Configuration
proxyBeanMethods:false
Imports
java.util.List, org.springframework.beans.factory.annotation.Autowired, org.springframework.context.annotation.Configuration, org.springframework.format.FormatterRegistry, org.springframework.http.converter.HttpMessageConverter, org.springframework.lang.Nullable, org.springframework.util.CollectionUtils, org.springframework.validation.MessageCodesResolver, .Validator, org.springframework.web.method.support.HandlerMethodArgumentResolver, .HandlerMethodReturnValueHandler, org.springframework.web.servlet.HandlerExceptionResolver

A subclass of 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.
Author
Rossen Stoyanchev
Since
3.1

Field Summary

Modifier and TypeField and Description
private final WebMvcConfigurerComposite

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
addArgumentResolvers(List<HandlerMethodArgumentResolver>
the list of custom converters (initially an empty list)
argumentResolvers
)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.addArgumentResolvers.

Add custom HandlerMethodArgumentResolvers to use in addition to the ones registered by default.

protected void
addCorsMappings(CorsRegistry registry)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.addCorsMappings.

Override this method to configure cross-origin requests processing.

protected void
protected void
addInterceptors(InterceptorRegistry registry)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.addInterceptors.

Override this method to add Spring MVC interceptors for pre- and post-processing of controller invocation.

protected void
addResourceHandlers(ResourceHandlerRegistry registry)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.addResourceHandlers.

Override this method to add resource handlers for serving static resources.

protected void
addReturnValueHandlers(List<HandlerMethodReturnValueHandler>
the list of custom handlers (initially an empty list)
returnValueHandlers
)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.addReturnValueHandlers.

Add custom HandlerMethodReturnValueHandlers in addition to the ones registered by default.

protected void
protected void
configureAsyncSupport(AsyncSupportConfigurer configurer)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.configureAsyncSupport.

Override this method to configure asynchronous request processing options.

protected void
protected void
protected void
configureHandlerExceptionResolvers(List<HandlerExceptionResolver>
a list to add exception resolvers to (initially an empty list)
exceptionResolvers
)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.configureHandlerExceptionResolvers.

Override this method to configure the list of HandlerExceptionResolvers to use.

protected void
protected void
protected void
protected void
extendHandlerExceptionResolvers(List<HandlerExceptionResolver>
the list of configured resolvers to extend.
exceptionResolvers
)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.extendHandlerExceptionResolvers.

Override this method to extend or modify the list of HandlerExceptionResolvers after it has been configured.

protected void
extendMessageConverters(List<HttpMessageConverter<?>>
the list of configured converters to extend
converters
)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.extendMessageConverters.

Override this method to extend or modify the list of converters after it has been configured.

protected MessageCodesResolver
protected Validator
public void
Inherited from org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport:
addDefaultHandlerExceptionResolversaddDefaultHttpMessageConvertersbeanNameHandlerMappingcreateExceptionHandlerExceptionResolvercreateRequestMappingHandlerAdaptercreateRequestMappingHandlerMappingdefaultServletHandlerMappingflashMapManagergetApplicationContextgetArgumentResolversgetAsyncSupportConfigurergetConfigurableWebBindingInitializergetCorsConfigurationsgetDefaultMediaTypesgetInterceptorsgetMessageConvertersgetPathMatchConfigurergetReturnValueHandlersgetServletContexthandlerExceptionResolverhandlerFunctionAdapterhttpRequestHandlerAdapterlocaleResolvermvcContentNegotiationManagermvcConversionServicemvcHandlerMappingIntrospectormvcPathMatchermvcPatternParsermvcResourceUrlProvidermvcUriComponentsContributormvcUrlPathHelpermvcValidatormvcViewResolverrequestMappingHandlerAdapterrequestMappingHandlerMappingresourceHandlerMappingrouterFunctionMappingsetApplicationContextsetServletContextsimpleControllerHandlerAdapterthemeResolverviewControllerHandlerMappingviewNameTranslator

Field Detail

configurersback to summary
private final WebMvcConfigurerComposite configurers

Constructor Detail

DelegatingWebMvcConfigurationback to summary
public DelegatingWebMvcConfiguration()

Method Detail

addArgumentResolversback to summary
protected void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.addArgumentResolvers.

Doc from org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.addArgumentResolvers.

Add custom HandlerMethodArgumentResolvers to 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 the RequestMappingHandlerAdapter directly.

Parameters
argumentResolvers:List<HandlerMethodArgumentResolver>

the list of custom converters (initially an empty list)

Annotations
@Override
addCorsMappingsback to summary
protected void addCorsMappings(CorsRegistry registry)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.addCorsMappings.

Doc from org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.addCorsMappings.

Override this method to configure cross-origin requests processing.

Annotations
@Override
addFormattersback to summary
protected void addFormatters(FormatterRegistry registry)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.addFormatters.

Doc from org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.addFormatters.

Override this method to add custom Converter and/or Formatter delegates to the common FormattingConversionService.

Annotations
@Override
addInterceptorsback to summary
protected void addInterceptors(InterceptorRegistry registry)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.addInterceptors.

Doc from org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.addInterceptors.

Override this method to add Spring MVC interceptors for pre- and post-processing of controller invocation.

Annotations
@Override
addResourceHandlersback to summary
protected void addResourceHandlers(ResourceHandlerRegistry registry)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.addResourceHandlers.

Doc from org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.addResourceHandlers.

Override this method to add resource handlers for serving static resources.

Annotations
@Override
addReturnValueHandlersback to summary
protected void addReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.addReturnValueHandlers.

Doc from org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.addReturnValueHandlers.

Add custom HandlerMethodReturnValueHandlers in 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 the RequestMappingHandlerAdapter directly.

Parameters
returnValueHandlers:List<HandlerMethodReturnValueHandler>

the list of custom handlers (initially an empty list)

Annotations
@Override
addViewControllersback to summary
protected void addViewControllers(ViewControllerRegistry registry)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.addViewControllers.

Doc from org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.addViewControllers.

Override this method to add view controllers.

Annotations
@Override
configureAsyncSupportback to summary
protected void configureAsyncSupport(AsyncSupportConfigurer configurer)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.configureAsyncSupport.

Doc from org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.configureAsyncSupport.

Override this method to configure asynchronous request processing options.

Annotations
@Override
configureContentNegotiationback to summary
protected void configureContentNegotiation(ContentNegotiationConfigurer configurer)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.configureContentNegotiation.

Doc from org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.configureContentNegotiation.

Override this method to configure content negotiation.

Annotations
@Override
configureDefaultServletHandlingback to summary
protected void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.configureDefaultServletHandling.

Doc from org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.configureDefaultServletHandling.

Override this method to configure "default" Servlet handling.

Annotations
@Override
configureHandlerExceptionResolversback to summary
protected void configureHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.configureHandlerExceptionResolvers.

Doc from org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.configureHandlerExceptionResolvers.

Override this method to configure the list of HandlerExceptionResolvers to use.

Adding resolvers to the list turns off the default resolvers that would otherwise be registered by default. Also see addDefaultHandlerExceptionResolvers that can be used to add the default exception resolvers.

Parameters
exceptionResolvers:List<HandlerExceptionResolver>

a list to add exception resolvers to (initially an empty list)

Annotations
@Override
configureMessageConvertersback to summary
protected void configureMessageConverters(List<HttpMessageConverter<?>> converters)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.configureMessageConverters.

Doc from org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.configureMessageConverters.

Override this method to add custom HttpMessageConverters to use with the RequestMappingHandlerAdapter and the ExceptionHandlerExceptionResolver.

Adding converters to the list turns off the default converters that would otherwise be registered by default. Also see addDefaultHttpMessageConverters for adding default message converters.

Parameters
converters:List<HttpMessageConverter<?>>

a list to add message converters to (initially an empty list)

Annotations
@Override
configurePathMatchback to summary
protected void configurePathMatch(PathMatchConfigurer configurer)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.configurePathMatch.

Doc from org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.configurePathMatch.

Override this method to configure path matching options.

Annotations
@Override
configureViewResolversback to summary
protected void configureViewResolvers(ViewResolverRegistry registry)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.configureViewResolvers.

Doc from org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.configureViewResolvers.

Override this method to configure view resolution.

Annotations
@Override
extendHandlerExceptionResolversback to summary
protected void extendHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.extendHandlerExceptionResolvers.

Doc from org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.extendHandlerExceptionResolvers.

Override this method to extend or modify the list of HandlerExceptionResolvers after 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.

Parameters
exceptionResolvers:List<HandlerExceptionResolver>

the list of configured resolvers to extend.

Annotations
@Override
extendMessageConvertersback to summary
protected void extendMessageConverters(List<HttpMessageConverter<?>> converters)

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.extendMessageConverters.

Doc from org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.extendMessageConverters.

Override 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.

Parameters
converters:List<HttpMessageConverter<?>>

the list of configured converters to extend

Annotations
@Override
getMessageCodesResolverback to summary
protected MessageCodesResolver getMessageCodesResolver()

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.getMessageCodesResolver.

Doc from org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.getMessageCodesResolver.

Override this method to provide a custom MessageCodesResolver.

Annotations
@Override
@Nullable
getValidatorback to summary
protected Validator getValidator()

Overrides org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.getValidator.

Doc from org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.getValidator.

Override this method to provide a custom Validator.

Annotations
@Override
@Nullable
setConfigurersback to summary
public void setConfigurers(List<WebMvcConfigurer> configurers)
Annotations
@Autowired
required:false