下面列出了怎么用org.springframework.boot.web.servlet.error.DefaultErrorAttributes的API类实例代码及写法,或者点击链接到github查看源代码。
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();
}
}
public ErrorController() {
super(new DefaultErrorAttributes(), new ErrorProperties());
}
public ErrorController() {
super(new DefaultErrorAttributes(), new ErrorProperties());
}
public DefaultErrorController() {
super(new DefaultErrorAttributes());
errorProperties = new ErrorProperties();
errorProperties.setPath("/error");
}
public CustomErrorController() {
super(new DefaultErrorAttributes());
}
public ErrorController() {
super(new DefaultErrorAttributes(), new ErrorProperties());
}
public AoomsGlobalErrorController(ServerProperties serverProperties) {
super(new DefaultErrorAttributes(), serverProperties.getError());
}
public CustomErrorController() {
super(new DefaultErrorAttributes());
}
private Map<String, Object> getErrorAttributes(WebRequest request) {
DefaultErrorAttributes errorAttributes = new DefaultErrorAttributes(false);
return errorAttributes.getErrorAttributes(request, false);
}
@Bean
@ConditionalOnMissingBean(value = ErrorAttributes.class, search = SearchStrategy.CURRENT)
public DefaultErrorAttributes errorAttributes() {
return new BladeErrorAttributes();
}
public GlobalBasicErrorHandler(ServerProperties serverProperties) {
super(new DefaultErrorAttributes(), serverProperties.getError());
}
public CustomErrorController() {
super(new DefaultErrorAttributes());
}