@ComponentScan(basePackages="cn.home1.oss.lib.errorhandle.starter")
@ConditionalOnClass(value={javax.servlet.Servlet.class,org.springframework.web.servlet.DispatcherServlet.class})
@ConditionalOnWebApplication
@Configuration
@EnableConfigurationProperties(value={cn.home1.oss.boot.autoconfigure.AppProperties.class,DefaultStackTraceIndicator.class})
@Import(value={ExceptionResolverConfiguration.class,FeignErrorDecoderConfiguration.class,ExceptionHandlerConfiguration.class})
@ServletComponentScan(basePackages="cn.home1.oss.lib.errorhandle.filter")
public class ErrorHandleAutoConfiguration
extends org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
implements org.springframework.context.ApplicationContextAware
ErrorMvcAutoConfiguration.
see: DefaultErrorAttributes
see: DelegatingWebMvcConfiguration
Extends WebMvcConfigurerAdapter make this visable to MockMvc tests,
does not override it's method.| Constructor and Description |
|---|
ErrorHandleAutoConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addDefaultHandlerExceptionResolvers(List<org.springframework.web.servlet.HandlerExceptionResolver> resolvers)
Deprecated.
see:
#addDefaultHandlerExceptionResolvers(List) addDefaultHandlerExceptionResolvers |
static ExceptionTranslator |
buildExceptionTranslator(cn.home1.oss.boot.autoconfigure.AppErrorProperties.SearchStrategy searchStrategy) |
static cn.home1.oss.lib.webmvc.api.TypeSafeCookie<ResolvedError> |
buildResolvedErrorCookie(cn.home1.oss.lib.webmvc.api.DomainResolver domainResolver,
com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
void |
configureHandlerExceptionResolvers(List<org.springframework.web.servlet.HandlerExceptionResolver> resolvers)
see:
WebMvcConfigurationSupport.handlerExceptionResolver(). |
ContentCachingRequestFilter |
contentCachingRequestFilter() |
ExtendedErrorAttributes |
errorAttributes() |
ExceptionTranslator |
exceptionTranslator() |
BaseErrorController.MixedErrorController |
mixedErrorController(ExtendedErrorAttributes errorAttributes) |
cn.home1.oss.lib.webmvc.api.TypeSafeCookie<ResolvedError> |
resolvedErrorCookie() |
BaseErrorController.RestfulErrorController |
restfulErrorController(ExtendedErrorAttributes errorAttributes) |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
BaseErrorController.TemplateErrorController |
templateErrorController(ExtendedErrorAttributes errorAttributes) |
addArgumentResolvers, addCorsMappings, addFormatters, addInterceptors, addResourceHandlers, addReturnValueHandlers, addViewControllers, configureAsyncSupport, configureContentNegotiation, configureDefaultServletHandling, configureMessageConverters, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, extendMessageConverters, getMessageCodesResolver, getValidator@Bean @ConditionalOnNotEnvProduction public ContentCachingRequestFilter contentCachingRequestFilter()
@Bean(name="resolvedErrorCookie") @ConditionalOnMissingBean(name="resolvedErrorCookie") public cn.home1.oss.lib.webmvc.api.TypeSafeCookie<ResolvedError> resolvedErrorCookie()
@Bean
@ConditionalOnMissingBean(value=org.springframework.boot.autoconfigure.web.ErrorAttributes.class,
search=CURRENT)
public ExtendedErrorAttributes errorAttributes()
@Bean
@ConditionalOnProperty(prefix="app",
name="type",
havingValue="RESTFUL",
matchIfMissing=false)
public BaseErrorController.RestfulErrorController restfulErrorController(ExtendedErrorAttributes errorAttributes)
@Bean
@ConditionalOnProperty(prefix="app",
name="type",
havingValue="TEMPLATE",
matchIfMissing=false)
public BaseErrorController.TemplateErrorController templateErrorController(ExtendedErrorAttributes errorAttributes)
@Bean
@ConditionalOnProperty(prefix="app",
name="type",
havingValue="MIXED",
matchIfMissing=true)
public BaseErrorController.MixedErrorController mixedErrorController(ExtendedErrorAttributes errorAttributes)
@Bean public ExceptionTranslator exceptionTranslator()
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
setApplicationContext in interface org.springframework.context.ApplicationContextAwarepublic void configureHandlerExceptionResolvers(List<org.springframework.web.servlet.HandlerExceptionResolver> resolvers)
WebMvcConfigurationSupport.handlerExceptionResolver().configureHandlerExceptionResolvers in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurerconfigureHandlerExceptionResolvers in class org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapterresolvers - resolvers@Deprecated protected final void addDefaultHandlerExceptionResolvers(List<org.springframework.web.servlet.HandlerExceptionResolver> resolvers)
#addDefaultHandlerExceptionResolvers(List) addDefaultHandlerExceptionResolversresolvers - exceptionResolverspublic static ExceptionTranslator buildExceptionTranslator(cn.home1.oss.boot.autoconfigure.AppErrorProperties.SearchStrategy searchStrategy)
public static cn.home1.oss.lib.webmvc.api.TypeSafeCookie<ResolvedError> buildResolvedErrorCookie(cn.home1.oss.lib.webmvc.api.DomainResolver domainResolver, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Copyright © 2017. All rights reserved.