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

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

public SmartGlobalErrorController(ErrorAttributes errorAttributes, ErrorControllerProperties config,
		CompositeErrorConfiguringAdapter adapter) {
	super(errorAttributes);
	notNull(config, "ErrorControllerProperties must not be null.");
	notNull(adapter, "CompositeErrorConfiguringAdapter must not be null.");
	this.config = config;
	this.adapter = adapter;
}
 
/**
 * 抄的是{@link ErrorMvcAutoConfiguration#basicErrorController(ErrorAttributes)}
 *
 * @param errorAttributes
 * @return
 */
@Bean
public CustomErrorController customErrorController(ErrorAttributes errorAttributes) {
  return new CustomErrorController(
      errorAttributes,
      this.serverProperties.getError(),
      this.errorViewResolvers
  );
}
 
源代码3 项目: searchbox-core   文件: SearchBoxConfiguration.java
@Bean
public ErrorAttributes customizeErrorResponseAttributes() {
    
	return new DefaultErrorAttributes(){
    	@Override
        public Map<String, Object> getErrorAttributes(RequestAttributes requestAttributes, boolean includeStackTrace) {
            Map<String, Object> errorAttributes = super.getErrorAttributes(requestAttributes, includeStackTrace);
            errorAttributes.remove("timestamp");
            errorAttributes.remove("exception");
            return errorAttributes;
        }
    };
    
}
 
@Bean
public SmartGlobalErrorController smartGlobalErrorController(ErrorAttributes errorAttrs,
		CompositeErrorConfiguringAdapter adapter, ErrorControllerProperties config) {
	return new SmartGlobalErrorController(errorAttrs, config, adapter);
}
 
源代码5 项目: NoteBlog   文件: ErrorController.java
public ErrorController(HttpServletRequest request, ErrorAttributes errorAttributes, ServerProperties serverProperties) {
    Assert.notNull(errorAttributes, "ErrorAttributes must not be null");
    this.errorAttributes = errorAttributes;
    this.serverProperties = serverProperties;
    this.request = request;
}
 
源代码6 项目: eagle   文件: ConsoleIndex.java
@Autowired
public ConsoleIndex(ErrorAttributes errorAttributes) {
    super(errorAttributes);
}
 
源代码7 项目: crnk-framework   文件: CrnkErrorController.java
public CrnkErrorController(ErrorAttributes errorAttributes,
						   ErrorProperties errorProperties) {
	super(errorAttributes, errorProperties);
}
 
源代码8 项目: crnk-framework   文件: CrnkErrorController.java
public CrnkErrorController(ErrorAttributes errorAttributes,
						   ErrorProperties errorProperties,
						   List<ErrorViewResolver> errorViewResolvers) {
	super(errorAttributes, errorProperties, errorViewResolvers);
}
 
@Bean
@ConditionalOnMissingBean(value = ErrorController.class, search = SearchStrategy.CURRENT)
public BasicErrorController jsonapiErrorController(ErrorAttributes errorAttributes) {
	return new CrnkErrorController(errorAttributes, this.serverProperties.getError(), this.errorViewResolvers);
}
 
public CustomErrorController(ErrorAttributes errorAttributes,
    ErrorProperties errorProperties) {
  super(errorAttributes, errorProperties);
}
 
public CustomErrorController(ErrorAttributes errorAttributes,
    ErrorProperties errorProperties,
    List<ErrorViewResolver> errorViewResolvers) {
  super(errorAttributes, errorProperties, errorViewResolvers);
}
 
@Bean
public ErrorAttributes errorAttributes() {
  return new CustomErrorAttributes();
}
 
@Bean
ErrorAttributes errorAttributes() {
    return new DefaultErrorAttributes();
}
 
源代码14 项目: onetwo   文件: ErrorHandleConfiguration.java
@Bean
@ConditionalOnMissingBean(DataResultErrorController.class)
public ErrorController dataResultErrorController(ErrorAttributes errorAttributes, ServerProperties serverProperties){
	return new DataResultErrorController(errorAttributes, serverProperties.getError(),
			this.errorViewResolvers);
}
 
源代码15 项目: onetwo   文件: DataResultErrorController.java
public DataResultErrorController(ErrorAttributes errorAttributes, ErrorProperties errorProperties) {
	super(errorAttributes, errorProperties);
}
 
源代码16 项目: onetwo   文件: DataResultErrorController.java
public DataResultErrorController(ErrorAttributes errorAttributes,
		ErrorProperties errorProperties,
		List<ErrorViewResolver> errorViewResolvers) {
	super(errorAttributes, errorProperties, errorViewResolvers);
}
 
源代码17 项目: fw-cloud-framework   文件: WxErrorController.java
/**
 * Controller for the Error Controller
 *
 * @param errorAttributes
 */

public WxErrorController(ErrorAttributes errorAttributes) {
	this.errorAttributes = errorAttributes;
}
 
 同包方法