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.WebMvcRegistrationsAt time of writing, this bean only gets hooked up withinWebMvcAutoConfiguration.org.springframework.web.servlet.handler.MappedInterceptorSince in the admin we have multiple handler mappings, we need to register aMappedInterceptorto apply to all of them.org.springframework.web.servlet.handler.MappedInterceptorvoidconfigureContentNegotiation(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.LocaleResolverMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
configureContentNegotiationin 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 aMappedInterceptorto apply to all of them. Modifying just tineInterceptorRegistrywill 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 itsDelegatingWebMvcConfigurationeventually goes to this pattern instead of requiring the workaround fromAdminWebMvcConfigurationSupportSPRING-UPGRADE-CHECK -
basicErrorController
-