类org.springframework.boot.autoconfigure.web.ErrorProperties源码实例Demo

下面列出了怎么用org.springframework.boot.autoconfigure.web.ErrorProperties的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: beihu-boot   文件: DefaultErrorController.java
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();
    }
}
 
源代码2 项目: springboot-learn   文件: ErrorPagesController.java
/**
 * Determine if the stacktrace attribute should be included.
 *
 * @param request  the source request
 * @param produces the media type produced (or {@code MediaType.ALL})
 * @return if the stacktrace attribute should be included
 */
protected boolean isIncludeStackTrace(HttpServletRequest request,
                                      MediaType produces) {
    ErrorProperties.IncludeStacktrace include = this.serverProperties.getError().getIncludeStacktrace();
    if (include == ErrorProperties.IncludeStacktrace.ALWAYS) {
        return true;
    }
    return include == ErrorProperties.IncludeStacktrace.ON_TRACE_PARAM && getTraceParameter(request);
}
 
源代码3 项目: syhthems-platform   文件: CustomErrorController.java
private boolean isIncludeStackTrace(HttpServletRequest request,
                                    MediaType produces) {
    ErrorProperties.IncludeStacktrace include = getErrorProperties().getIncludeStacktrace();
    if (include == ErrorProperties.IncludeStacktrace.ALWAYS) {
        return true;
    }
    if (include == ErrorProperties.IncludeStacktrace.ON_TRACE_PARAM) {
        return getTraceParameter(request);
    }
    return false;
}
 
源代码4 项目: springboot-shiro   文件: ErrorPagesController.java
/**
 * Determine if the stacktrace attribute should be included.
 *
 * @param request  the source request
 * @param produces the media type produced (or {@code MediaType.ALL})
 * @return if the stacktrace attribute should be included
 */
protected boolean isIncludeStackTrace(HttpServletRequest request,
                                      MediaType produces) {
    ErrorProperties.IncludeStacktrace include = this.serverProperties.getError().getIncludeStacktrace();
    if (include == ErrorProperties.IncludeStacktrace.ALWAYS) {
        return true;
    }
    return include == ErrorProperties.IncludeStacktrace.ON_TRACE_PARAM && getTraceParameter(request);
}
 
源代码5 项目: halo   文件: CommonController.java
/**
 * Determine if the stacktrace attribute should be included.
 *
 * @param request the source request
 * @return if the stacktrace attribute should be included
 */
private boolean isIncludeStackTrace(HttpServletRequest request) {
    ErrorProperties.IncludeStacktrace include = errorProperties.getIncludeStacktrace();
    if (include == ErrorProperties.IncludeStacktrace.ALWAYS) {
        return true;
    }
    if (include == ErrorProperties.IncludeStacktrace.ON_TRACE_PARAM) {
        return getTraceParameter(request);
    }
    return false;
}
 
@Before
public void beforeMethod() {
    projectApiErrorsMock = mock(ProjectApiErrors.class);
    unhandledContainerErrorHelperMock = mock(UnhandledServletContainerErrorHelper.class);
    servletRequestMock = mock(ServletRequest.class);
    serverPropertiesMock = mock(ServerProperties.class);
    errorPropertiesMock = mock(ErrorProperties.class);
    errorPath = UUID.randomUUID().toString();

    doReturn(errorPropertiesMock).when(serverPropertiesMock).getError();
    doReturn(errorPath).when(errorPropertiesMock).getPath();
}
 
@Before
public void beforeMethod() {
    projectApiErrorsMock = mock(ProjectApiErrors.class);
    unhandledContainerErrorHelperMock = mock(UnhandledServletContainerErrorHelper.class);
    servletRequestMock = mock(ServletRequest.class);
    serverPropertiesMock = mock(ServerProperties.class);
    errorPropertiesMock = mock(ErrorProperties.class);
    errorPath = UUID.randomUUID().toString();

    doReturn(errorPropertiesMock).when(serverPropertiesMock).getError();
    doReturn(errorPath).when(errorPropertiesMock).getPath();
}
 
private DefaultErrorWebExceptionHandler errorHandler(GenericApplicationContext context) {
	context.registerBean(ErrorAttributes.class, () -> new DefaultErrorAttributes());
	context.registerBean(ErrorProperties.class, () -> new ErrorProperties());
	context.registerBean(ResourceProperties.class, () -> new ResourceProperties());
	DefaultErrorWebExceptionHandler handler = new DefaultErrorWebExceptionHandler(
			context.getBean(ErrorAttributes.class), context.getBean(ResourceProperties.class),
			context.getBean(ErrorProperties.class), context);
	ServerCodecConfigurer codecs = ServerCodecConfigurer.create();
	handler.setMessageWriters(codecs.getWriters());
	handler.setMessageReaders(codecs.getReaders());
	return handler;
}
 
源代码9 项目: WeBASE-Node-Manager   文件: ErrorController.java
public ErrorController() {
    super(new DefaultErrorAttributes(), new ErrorProperties());
}
 
源代码10 项目: codeway_service   文件: GlobalExceptionHandler.java
public GlobalExceptionHandler(ErrorAttributes errorAttributes, ResourceProperties resourceProperties,
                              ErrorProperties errorProperties, ApplicationContext applicationContext) {
	super(errorAttributes, resourceProperties, errorProperties, applicationContext);
}
 
源代码11 项目: uexam   文件: ErrorController.java
public ErrorController() {
    super(new DefaultErrorAttributes(), new ErrorProperties());
}
 
源代码12 项目: beihu-boot   文件: DefaultErrorController.java
public DefaultErrorController() {
    super(new DefaultErrorAttributes());
    errorProperties = new ErrorProperties();
    errorProperties.setPath("/error");
}
 
public JsonExceptionHandler(ErrorAttributes errorAttributes, ResourceProperties resourceProperties,
		ErrorProperties errorProperties, ApplicationContext applicationContext) {
	super(errorAttributes, resourceProperties, errorProperties, applicationContext);
}
 
源代码14 项目: FEBS-Cloud   文件: FebsGatewayExceptionHandler.java
public FebsGatewayExceptionHandler(ErrorAttributes errorAttributes, ResourceProperties resourceProperties,
                                   ErrorProperties errorProperties, ApplicationContext applicationContext) {
    super(errorAttributes, resourceProperties, errorProperties, applicationContext);
}
 
public JsonErrorWebExceptionHandler(ErrorAttributes errorAttributes, ResourceProperties resourceProperties,
                                    ErrorProperties errorProperties, ApplicationContext applicationContext) {
    super(errorAttributes, resourceProperties, errorProperties, applicationContext);
}
 
源代码16 项目: SpringBlade   文件: ErrorExceptionHandler.java
public ErrorExceptionHandler(ErrorAttributes errorAttributes, ResourceProperties resourceProperties,
							 ErrorProperties errorProperties, ApplicationContext applicationContext) {
	super(errorAttributes, resourceProperties, errorProperties, applicationContext);
}
 
源代码17 项目: uexam-mysql   文件: ErrorController.java
public ErrorController() {
    super(new DefaultErrorAttributes(), new ErrorProperties());
}
 
public FwGatewayExceptionHandler(ErrorAttributes errorAttributes, ResourceProperties resourceProperties,
                                 ErrorProperties errorProperties, ApplicationContext applicationContext) {
    super(errorAttributes, resourceProperties, errorProperties, applicationContext);
}
 
public JsonExceptionHandler(ErrorAttributes errorAttributes, ResourceProperties resourceProperties,
                            ErrorProperties errorProperties, ApplicationContext applicationContext) {
    super(errorAttributes, resourceProperties, errorProperties, applicationContext);
}
 
源代码20 项目: sophia_scaffolding   文件: JsonExceptionHandler.java
public JsonExceptionHandler(ErrorAttributes errorAttributes, ResourceProperties resourceProperties,
                            ErrorProperties errorProperties, ApplicationContext applicationContext) {
    super(errorAttributes, resourceProperties, errorProperties, applicationContext);
}
 
源代码21 项目: sophia_scaffolding   文件: JsonExceptionHandler.java
public JsonExceptionHandler(ErrorAttributes errorAttributes, ResourceProperties resourceProperties,
                            ErrorProperties errorProperties, ApplicationContext applicationContext) {
    super(errorAttributes, resourceProperties, errorProperties, applicationContext);
}
 
源代码22 项目: sophia_scaffolding   文件: JsonExceptionHandler.java
public JsonExceptionHandler(ErrorAttributes errorAttributes, ResourceProperties resourceProperties,
                            ErrorProperties errorProperties, ApplicationContext applicationContext) {
    super(errorAttributes, resourceProperties, errorProperties, applicationContext);
}
 
源代码23 项目: syhthems-platform   文件: CustomErrorController.java
private ErrorProperties getErrorProperties() {
    return this.errorProperties;
}
 
源代码24 项目: codeway_service   文件: GlobalExceptionHandler.java
public GlobalExceptionHandler(ErrorAttributes errorAttributes, ResourceProperties resourceProperties,
                              ErrorProperties errorProperties, ApplicationContext applicationContext) {
	super(errorAttributes, resourceProperties, errorProperties, applicationContext);
}
 
public CustomServletErrorController(ErrorAttributes errorAttributes,
                                    ErrorProperties errorProperties,
                                    List<ErrorViewResolver> resolvers) {
    super(errorAttributes, errorProperties, resolvers);
}
 
源代码26 项目: NoteBlog   文件: ErrorController.java
private boolean isIncludeStackTrace(HttpServletRequest request) {
    ErrorProperties.IncludeStacktrace include = this.serverProperties.getError().getIncludeStacktrace();
    return include == ErrorProperties.IncludeStacktrace.ALWAYS || include == ErrorProperties.IncludeStacktrace.ON_TRACE_PARAM && getTraceParameter(request);
}
 
源代码27 项目: blade-tool   文件: BladeErrorController.java
public BladeErrorController(ErrorAttributes errorAttributes, ErrorProperties errorProperties) {
	super(errorAttributes, errorProperties);
}
 
源代码28 项目: crnk-framework   文件: CrnkErrorController.java
public CrnkErrorController(ErrorAttributes errorAttributes,
						   ErrorProperties errorProperties) {
	super(errorAttributes, errorProperties);
}
 
源代码29 项目: crnk-framework   文件: CrnkErrorController.java
public CrnkErrorController(ErrorAttributes errorAttributes,
						   ErrorProperties errorProperties,
						   List<ErrorViewResolver> errorViewResolvers) {
	super(errorAttributes, errorProperties, errorViewResolvers);
}
 
源代码30 项目: crnk-framework   文件: CrnkErrorController.java
public CrnkErrorController(ErrorAttributes errorAttributes,
						   ErrorProperties errorProperties) {
	super(errorAttributes, errorProperties);
}
 
 同包方法