org.springframework.boot.web.servlet.error.ErrorAttributes Java Examples

The following examples show how to use org.springframework.boot.web.servlet.error.ErrorAttributes. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DefaultErrorController.java    From beihu-boot with Apache License 2.0 5 votes vote down vote up
public DefaultErrorController(ErrorAttributes errorAttributes, ServerProperties properties) {
    super(errorAttributes == null ? new DefaultErrorAttributes() : errorAttributes);
    if (properties == null) {
        errorProperties = new ErrorProperties();
        errorProperties.setPath("/error");
    } else {
        this.errorProperties = properties.getError();
    }
}
 
Example #2
Source File: CommonController.java    From halo with GNU General Public License v3.0 5 votes vote down vote up
public CommonController(ThemeService themeService,
                        ErrorAttributes errorAttributes,
                        ServerProperties serverProperties,
                        OptionService optionService) {
    super(errorAttributes);
    this.themeService = themeService;
    this.errorProperties = serverProperties.getError();
    this.optionService = optionService;
}
 
Example #3
Source File: ServletErrorsAutoConfiguration.java    From errors-spring-boot-starter with Apache License 2.0 5 votes vote down vote up
/**
 * Registers a custom {@link ErrorController} to change the default error handling approach.
 *
 * @param errorAttributes    Will be used to enrich error responses.
 * @param serverProperties   Will be used to access error related configurations.
 * @param errorViewResolvers All possible view resolvers to render the whitelabel error page.
 * @return The custom error controller instance.
 */
@Bean
@ConditionalOnBean(WebErrorHandlers.class)
@ConditionalOnMissingBean(ErrorController.class)
public BasicErrorController customErrorController(ErrorAttributes errorAttributes,
                                             ServerProperties serverProperties,
                                             ObjectProvider<ErrorViewResolver> errorViewResolvers) {
    List<ErrorViewResolver> resolvers = errorViewResolvers.orderedStream().collect(toList());
    return new CustomServletErrorController(errorAttributes, serverProperties.getError(), resolvers);
}
 
Example #4
Source File: CrnkErrorControllerAutoConfiguration.java    From crnk-framework with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean(value = ErrorController.class, search = SearchStrategy.CURRENT)
public BasicErrorController jsonapiErrorController(ErrorAttributes errorAttributes) {
	return new CrnkErrorController(errorAttributes, this.serverProperties.getError(), this.errorViewResolvers);
}
 
Example #5
Source File: ErrorPageController.java    From My-Blog with Apache License 2.0 4 votes vote down vote up
public ErrorPageController(ErrorAttributes errorAttributes) {
    this.errorAttributes = errorAttributes;
}
 
Example #6
Source File: ErrorPageController.java    From Microservices-with-Spring-Cloud with MIT License 4 votes vote down vote up
public ErrorPageController(ErrorAttributes errorAttributes, List<ErrorViewResolver> errorViewResolvers) {
    super(errorAttributes, errorViewResolvers);
}
 
Example #7
Source File: ErrorPagesController.java    From OneBlog with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 初始化ExceptionController
 *
 * @param errorAttributes
 */
@Autowired
public ErrorPagesController(ErrorAttributes errorAttributes) {
    Assert.notNull(errorAttributes, "ErrorAttributes must not be null");
    this.errorAttributes = errorAttributes;
}
 
Example #8
Source File: SkipperServerConfiguration.java    From spring-cloud-skipper with Apache License 2.0 4 votes vote down vote up
@Bean
public ErrorAttributes errorAttributes() {
	// override boot's DefaultErrorAttributes
	return new SkipperErrorAttributes();
}
 
Example #9
Source File: ServerDependencies.java    From spring-cloud-skipper with Apache License 2.0 4 votes vote down vote up
@Bean
public ErrorAttributes errorAttributes() {
	// override boot's DefaultErrorAttributes
	return new SkipperErrorAttributes();
}
 
Example #10
Source File: ErrorPageController.java    From spring-boot-projects with Apache License 2.0 4 votes vote down vote up
public ErrorPageController(ErrorAttributes errorAttributes) {
    this.errorAttributes = errorAttributes;
}
 
Example #11
Source File: ErrorPageController.java    From spring-boot-projects with Apache License 2.0 4 votes vote down vote up
public ErrorPageController(ErrorAttributes errorAttributes) {
    this.errorAttributes = errorAttributes;
}
 
Example #12
Source File: BladeErrorMvcAutoConfiguration.java    From blade-tool with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean(value = ErrorController.class, search = SearchStrategy.CURRENT)
public BasicErrorController basicErrorController(ErrorAttributes errorAttributes) {
	return new BladeErrorController(errorAttributes, serverProperties.getError());
}
 
Example #13
Source File: CrnkErrorController.java    From crnk-framework with Apache License 2.0 4 votes vote down vote up
public CrnkErrorController(ErrorAttributes errorAttributes,
						   ErrorProperties errorProperties) {
	super(errorAttributes, errorProperties);
}
 
Example #14
Source File: CrnkErrorController.java    From crnk-framework with Apache License 2.0 4 votes vote down vote up
public CrnkErrorController(ErrorAttributes errorAttributes,
						   ErrorProperties errorProperties,
						   List<ErrorViewResolver> errorViewResolvers) {
	super(errorAttributes, errorProperties, errorViewResolvers);
}
 
Example #15
Source File: WebClientTests.java    From spring-cloud-sleuth with Apache License 2.0 4 votes vote down vote up
@Bean
TestErrorController testErrorController(ErrorAttributes errorAttributes,
		Tracing tracer) {
	return new TestErrorController(errorAttributes, tracer.tracer());
}
 
Example #16
Source File: WebClientTests.java    From spring-cloud-sleuth with Apache License 2.0 4 votes vote down vote up
public TestErrorController(ErrorAttributes errorAttributes, Tracer tracer) {
	super(errorAttributes, new ServerProperties().getError());
	this.tracer = tracer;
}
 
Example #17
Source File: GenericErrorController.java    From kork with Apache License 2.0 4 votes vote down vote up
public GenericErrorController(ErrorAttributes errorAttributes) {
  this.errorAttributes = errorAttributes;
}
 
Example #18
Source File: CommonErrorController.java    From EasyReport with Apache License 2.0 4 votes vote down vote up
public CommonErrorController(final ErrorAttributes errorAttributes,
                             ErrorProperties errorProperties) {
    super(errorAttributes);
    this.errorProperties = errorProperties;
}
 
Example #19
Source File: CustomErrorController.java    From EasyReport with Apache License 2.0 4 votes vote down vote up
public CustomErrorController(final ErrorAttributes errorAttributes,
                             final ErrorProperties errorProperties) {
    super(errorAttributes, errorProperties);
}
 
Example #20
Source File: MyErrorController.java    From tutorials with MIT License 4 votes vote down vote up
public MyErrorController(ErrorAttributes errorAttributes) {
    super(errorAttributes, new ErrorProperties());
}
 
Example #21
Source File: BladeErrorController.java    From blade-tool with GNU Lesser General Public License v3.0 4 votes vote down vote up
public BladeErrorController(ErrorAttributes errorAttributes, ErrorProperties errorProperties) {
	super(errorAttributes, errorProperties);
}
 
Example #22
Source File: ErrorEndpoint.java    From authmore-framework with Apache License 2.0 4 votes vote down vote up
public ErrorEndpoint(ErrorAttributes errorAttributes) {
    super(errorAttributes);
}
 
Example #23
Source File: ExceptionTranslator.java    From springdoc-openapi with Apache License 2.0 4 votes vote down vote up
public ExceptionTranslator(ErrorAttributes errorAttributes) {
	this.errorAttributes = errorAttributes;
}
 
Example #24
Source File: ExceptionTranslator.java    From springdoc-openapi with Apache License 2.0 4 votes vote down vote up
public ExceptionTranslator(ErrorAttributes errorAttributes) {
	this.errorAttributes = errorAttributes;
}
 
Example #25
Source File: ExceptionTranslator.java    From springdoc-openapi with Apache License 2.0 4 votes vote down vote up
public ExceptionTranslator(ErrorAttributes errorAttributes) {
	this.errorAttributes = errorAttributes;
}
 
Example #26
Source File: ErrorPageController.java    From My-Blog-layui with Apache License 2.0 4 votes vote down vote up
public ErrorPageController(ErrorAttributes errorAttributes) {
    this.errorAttributes = errorAttributes;
}
 
Example #27
Source File: ErrorPageController.java    From newbee-mall with GNU General Public License v3.0 4 votes vote down vote up
public ErrorPageController(ErrorAttributes errorAttributes) {
    this.errorAttributes = errorAttributes;
}
 
Example #28
Source File: ErrorPagesController.java    From springboot-learn with MIT License 4 votes vote down vote up
/**
 * 初始化ExceptionController
 *
 * @param errorAttributes
 */
@Autowired
public ErrorPagesController(ErrorAttributes errorAttributes) {
    Assert.notNull(errorAttributes, "ErrorAttributes must not be null");
    this.errorAttributes = errorAttributes;
}
 
Example #29
Source File: CustomErrorController.java    From syhthems-platform with MIT License 4 votes vote down vote up
@Autowired
public CustomErrorController(ErrorAttributes errorAttributes, ServerProperties serverProperties) {
    super(errorAttributes);
    this.errorProperties = serverProperties.getError();
}
 
Example #30
Source File: MyErrorController.java    From spring-cloud-yes with Apache License 2.0 4 votes vote down vote up
@Autowired
public MyErrorController(ErrorAttributes errorAttributes, ServerProperties serverProperties) {
    super(errorAttributes, serverProperties.getError());
}