public class BroadleafRestApiMvcConfiguration
extends org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
Default Broadleaf-recommended configuration for REST APIs
The child class must also be added as the contextConfigLocation for a new DispatcherServlet
servlet with contextClass AnnotationConfigWebApplicationContext in web.xml.
| Constructor and Description |
|---|
BroadleafRestApiMvcConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
protected org.broadleafcommerce.common.web.filter.EntityManagerFindValidationFilter |
blEntityManagerFindValidationFilter() |
protected org.broadleafcommerce.common.web.controller.FrameworkControllerHandlerMapping |
blFrameworkControllerHandlerMapping() |
protected WrapperOverrideTypeModifier |
blWrapperOverrideTypeModifier() |
void |
configureContentNegotiation(org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer configurer)
Setup a simple strategy: use all the defaults and return JSON by default when not sure.
|
void |
configureMessageConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> converters) |
protected org.springframework.http.converter.HttpMessageConverter<?> |
getJsonConverter() |
protected com.fasterxml.jackson.databind.ObjectMapper |
getObjectMapper(boolean useXml) |
protected org.springframework.http.converter.json.Jackson2ObjectMapperBuilder |
getObjectMapperBuilder() |
protected org.springframework.http.converter.HttpMessageConverter<?> |
getXmlConverter()
Subclasses might override this method to use JAXB natively for XML serialization by
return new Jaxb2RootElementHttpMessageConverter() |
addArgumentResolvers, addCorsMappings, addFormatters, addInterceptors, addResourceHandlers, addReturnValueHandlers, addViewControllers, configureAsyncSupport, configureDefaultServletHandling, configureHandlerExceptionResolvers, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, extendMessageConverters, getMessageCodesResolver, getValidatorpublic void configureMessageConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> converters)
configureMessageConverters in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurerconfigureMessageConverters in class org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapterpublic 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.WebMvcConfigurerAdapterprotected org.springframework.http.converter.HttpMessageConverter<?> getJsonConverter()
protected org.springframework.http.converter.HttpMessageConverter<?> getXmlConverter()
return new Jaxb2RootElementHttpMessageConverter()#getObjectMapper(boolean)}protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper(boolean useXml)
protected org.springframework.http.converter.json.Jackson2ObjectMapperBuilder getObjectMapperBuilder()
@Bean protected WrapperOverrideTypeModifier blWrapperOverrideTypeModifier()
@Bean protected org.broadleafcommerce.common.web.filter.EntityManagerFindValidationFilter blEntityManagerFindValidationFilter()
@Bean protected org.broadleafcommerce.common.web.controller.FrameworkControllerHandlerMapping blFrameworkControllerHandlerMapping()
Copyright © 2020. All rights reserved.