下面列出了怎么用org.springframework.boot.autoconfigure.web.ErrorController的API类实例代码及写法,或者点击链接到github查看源代码。
@Bean
@ConditionalOnMissingBean(value = ErrorController.class, search = SearchStrategy.CURRENT)
public BasicErrorController jsonapiErrorController(ErrorAttributes errorAttributes) {
return new CrnkErrorController(errorAttributes, this.serverProperties.getError(), this.errorViewResolvers);
}
@Bean
@ConditionalOnMissingBean(DataResultErrorController.class)
public ErrorController dataResultErrorController(ErrorAttributes errorAttributes, ServerProperties serverProperties){
return new DataResultErrorController(errorAttributes, serverProperties.getError(),
this.errorViewResolvers);
}