@Configuration
public static class AdminWebMvcConfiguration.AdminDefaultWebMvcConfigurerAdapter
extends org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
| Constructor and Description |
|---|
AdminDefaultWebMvcConfigurerAdapter() |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.boot.autoconfigure.web.WebMvcRegistrationsAdapter |
blAdminMvcRegistrations()
At time of writing, this bean only gets hooked up within
WebMvcAutoConfiguration. |
org.springframework.web.servlet.handler.MappedInterceptor |
blJsFieldNameCompatibilityInterceptor()
Since in the admin we have multiple handler mappings, we need to register a
MappedInterceptor
to apply to all of them. |
org.springframework.web.servlet.handler.MappedInterceptor |
blLocaleChangeInterceptor() |
void |
configureContentNegotiation(org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer configurer)
Set the default media type to JSON because AJAX calls from the admin UI are expecting JSON.
|
org.springframework.web.servlet.LocaleResolver |
localeResolver() |
addArgumentResolvers, addCorsMappings, addFormatters, addInterceptors, addResourceHandlers, addReturnValueHandlers, addViewControllers, configureAsyncSupport, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, extendMessageConverters, getMessageCodesResolver, getValidatorpublic void configureContentNegotiation(org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer configurer)
configureContentNegotiation in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurerconfigureContentNegotiation in class org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter@Bean public org.springframework.web.servlet.handler.MappedInterceptor blJsFieldNameCompatibilityInterceptor()
MappedInterceptor
to apply to all of them. Modifying just tine InterceptorRegistry will apply those
interceptors to _only_ the default RequestMappingHandlerMapping.@Bean public org.springframework.web.servlet.handler.MappedInterceptor blLocaleChangeInterceptor()
@Bean public org.springframework.web.servlet.LocaleResolver localeResolver()
@Bean public org.springframework.boot.autoconfigure.web.WebMvcRegistrationsAdapter blAdminMvcRegistrations()
WebMvcAutoConfiguration. Providing it here
regardless since it is harmless in general, and it is likely that perhaps Spring Web in its DelegatingWebMvcConfiguration
eventually goes to this pattern instead of requiring the workaround from AdminWebMvcConfigurationSupport
SPRING-UPGRADE-CHECKCopyright © 2018. All rights reserved.