类 DelegatingWebMvcConfiguration
- java.lang.Object
- org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport
- org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration
- 所有已实现的接口:
Aware,ApplicationContextAware,ServletContextAware
@Configuration(proxyBeanMethods=false) public class DelegatingWebMvcConfiguration extends WebMvcConfigurationSupport
A subclass ofWebMvcConfigurationSupportthat detects and delegates to all beans of typeWebMvcConfigurerallowing them to customize the configuration provided byWebMvcConfigurationSupport. This is the class actually imported by@EnableWebMvc.- 从以下版本开始:
- 3.1
- 作者:
- Rossen Stoyanchev
构造器概要
构造器 构造器 说明 DelegatingWebMvcConfiguration()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected 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 voidconfigureContentNegotiation(ContentNegotiationConfigurer configurer)Override this method to configure content negotiation.protected voidconfigureDefaultServletHandling(DefaultServletHandlerConfigurer configurer)Override 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 MessageCodesResolvergetMessageCodesResolver()Override this method to provide a customMessageCodesResolver.protected ValidatorgetValidator()Override this method to provide a customValidator.voidsetConfigurers(List<WebMvcConfigurer> configurers)从类继承的方法 org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport
addDefaultHandlerExceptionResolvers, addDefaultHttpMessageConverters, beanNameHandlerMapping, createExceptionHandlerExceptionResolver, createRequestMappingHandlerAdapter, createRequestMappingHandlerMapping, defaultServletHandlerMapping, getApplicationContext, getArgumentResolvers, getConfigurableWebBindingInitializer, getCorsConfigurations, getDefaultMediaTypes, getInterceptors, getMessageConverters, getPathMatchConfigurer, getReturnValueHandlers, getServletContext, handlerExceptionResolver, handlerFunctionAdapter, httpRequestHandlerAdapter, mvcContentNegotiationManager, mvcConversionService, mvcHandlerMappingIntrospector, mvcPathMatcher, mvcResourceUrlProvider, mvcUriComponentsContributor, mvcUrlPathHelper, mvcValidator, mvcViewResolver, requestMappingHandlerAdapter, requestMappingHandlerMapping, resourceHandlerMapping, routerFunctionMapping, setApplicationContext, setServletContext, simpleControllerHandlerAdapter, viewControllerHandlerMapping
构造器详细资料
DelegatingWebMvcConfiguration
public DelegatingWebMvcConfiguration()
方法详细资料
setConfigurers
@Autowired(required=false) public void setConfigurers(List<WebMvcConfigurer> configurers)
configurePathMatch
protected void configurePathMatch(PathMatchConfigurer configurer)
从类复制的说明:WebMvcConfigurationSupportOverride this method to configure path matching options.
configureContentNegotiation
protected void configureContentNegotiation(ContentNegotiationConfigurer configurer)
从类复制的说明:WebMvcConfigurationSupportOverride this method to configure content negotiation.
configureAsyncSupport
protected void configureAsyncSupport(AsyncSupportConfigurer configurer)
从类复制的说明:WebMvcConfigurationSupportOverride this method to configure asynchronous request processing options.
configureDefaultServletHandling
protected void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer)
从类复制的说明:WebMvcConfigurationSupportOverride this method to configure "default" Servlet handling.
addFormatters
protected void addFormatters(FormatterRegistry registry)
从类复制的说明:WebMvcConfigurationSupportOverride this method to add customConverterand/orFormatterdelegates to the commonFormattingConversionService.
addInterceptors
protected void addInterceptors(InterceptorRegistry registry)
从类复制的说明:WebMvcConfigurationSupportOverride this method to add Spring MVC interceptors for pre- and post-processing of controller invocation.
addResourceHandlers
protected void addResourceHandlers(ResourceHandlerRegistry registry)
从类复制的说明:WebMvcConfigurationSupportOverride this method to add resource handlers for serving static resources.
addCorsMappings
protected void addCorsMappings(CorsRegistry registry)
从类复制的说明:WebMvcConfigurationSupportOverride this method to configure cross origin requests processing.
addViewControllers
protected void addViewControllers(ViewControllerRegistry registry)
从类复制的说明:WebMvcConfigurationSupportOverride this method to add view controllers.
configureViewResolvers
protected void configureViewResolvers(ViewResolverRegistry registry)
从类复制的说明:WebMvcConfigurationSupportOverride this method to configure view resolution.
addArgumentResolvers
protected void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers)
从类复制的说明: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.- 覆盖:
addArgumentResolvers在类中WebMvcConfigurationSupport- 参数:
argumentResolvers- the list of custom converters (initially an empty list)
addReturnValueHandlers
protected void addReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers)
从类复制的说明: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.- 覆盖:
addReturnValueHandlers在类中WebMvcConfigurationSupport- 参数:
returnValueHandlers- the list of custom handlers (initially an empty list)
configureMessageConverters
protected void configureMessageConverters(List<HttpMessageConverter<?>> converters)
从类复制的说明: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.- 覆盖:
configureMessageConverters在类中WebMvcConfigurationSupport- 参数:
converters- a list to add message converters to (initially an empty list)
extendMessageConverters
protected void extendMessageConverters(List<HttpMessageConverter<?>> converters)
从类复制的说明: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.- 覆盖:
extendMessageConverters在类中WebMvcConfigurationSupport- 参数:
converters- the list of configured converters to extend
configureHandlerExceptionResolvers
protected void configureHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers)
从类复制的说明: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.- 覆盖:
configureHandlerExceptionResolvers在类中WebMvcConfigurationSupport- 参数:
exceptionResolvers- a list to add exception resolvers to (initially an empty list)
extendHandlerExceptionResolvers
protected void extendHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers)
从类复制的说明: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.
- 覆盖:
extendHandlerExceptionResolvers在类中WebMvcConfigurationSupport- 参数:
exceptionResolvers- the list of configured resolvers to extend.
getValidator
@Nullable protected Validator getValidator()
从类复制的说明:WebMvcConfigurationSupportOverride this method to provide a customValidator.
getMessageCodesResolver
@Nullable protected MessageCodesResolver getMessageCodesResolver()
从类复制的说明:WebMvcConfigurationSupportOverride this method to provide a customMessageCodesResolver.