Class AdminWebMvcConfiguration.AdminDefaultWebMvcConfigurerAdapter
java.lang.Object
org.broadleafcommerce.openadmin.web.controller.config.AdminWebMvcConfiguration.AdminDefaultWebMvcConfigurerAdapter
- All Implemented Interfaces:
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
- Enclosing class:
- AdminWebMvcConfiguration
@Configuration
public static class AdminWebMvcConfiguration.AdminDefaultWebMvcConfigurerAdapter
extends Object
implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations
At time of writing, this bean only gets hooked up withinWebMvcAutoConfiguration
.org.springframework.web.servlet.handler.MappedInterceptor
Since in the admin we have multiple handler mappings, we need to register aMappedInterceptor
to apply to all of them.org.springframework.web.servlet.handler.MappedInterceptor
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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
addArgumentResolvers, addCorsMappings, addErrorResponseInterceptors, addFormatters, addInterceptors, addResourceHandlers, addReturnValueHandlers, addViewControllers, configureAsyncSupport, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, extendMessageConverters, getMessageCodesResolver, getValidator
-
Constructor Details
-
AdminDefaultWebMvcConfigurerAdapter
public AdminDefaultWebMvcConfigurerAdapter()
-
-
Method Details
-
configureContentNegotiation
public 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.- Specified by:
configureContentNegotiation
in interfaceorg.springframework.web.servlet.config.annotation.WebMvcConfigurer
-
blJsFieldNameCompatibilityInterceptor
@Bean public org.springframework.web.servlet.handler.MappedInterceptor blJsFieldNameCompatibilityInterceptor()Since in the admin we have multiple handler mappings, we need to register aMappedInterceptor
to apply to all of them. Modifying just tineInterceptorRegistry
will apply those interceptors to _only_ the default RequestMappingHandlerMapping. -
blLocaleChangeInterceptor
@Bean public org.springframework.web.servlet.handler.MappedInterceptor blLocaleChangeInterceptor() -
localeResolver
@Bean public org.springframework.web.servlet.LocaleResolver localeResolver() -
blAdminMvcRegistrations
@Bean public org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations blAdminMvcRegistrations()At time of writing, this bean only gets hooked up withinWebMvcAutoConfiguration
. Providing it here regardless since it is harmless in general, and it is likely that perhaps Spring Web in itsDelegatingWebMvcConfiguration
eventually goes to this pattern instead of requiring the workaround fromAdminWebMvcConfigurationSupport
SPRING-UPGRADE-CHECK -
basicErrorController
-