Java 类org.springframework.boot.web.servlet.ErrorPageRegistry 实例源码

项目:scoold    文件:ScooldServer.java   
/**
 * @return Error page registry bean
 */
@Bean
public ErrorPageRegistrar errorPageRegistrar() {
    return new ErrorPageRegistrar() {
        @Override
        public void registerErrorPages(ErrorPageRegistry epr) {
            epr.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/not-found"));
            epr.addErrorPages(new ErrorPage(HttpStatus.FORBIDDEN, "/error/403"));
            epr.addErrorPages(new ErrorPage(HttpStatus.UNAUTHORIZED, "/error/403"));
            epr.addErrorPages(new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/error/500"));
            epr.addErrorPages(new ErrorPage(HttpStatus.SERVICE_UNAVAILABLE, "/error/503"));
            epr.addErrorPages(new ErrorPage(HttpStatus.BAD_REQUEST, "/error/400"));
            epr.addErrorPages(new ErrorPage(HttpStatus.METHOD_NOT_ALLOWED, "/error/405"));
            epr.addErrorPages(new ErrorPage(Exception.class, "/error/500"));
        }
    };
}
项目:dotwebstack-framework    文件:ServletErrorPageRegistrar.java   
@Override
public void registerErrorPages(@NonNull ErrorPageRegistry registry) {
  for (HttpStatus httpStatus : HttpStatus.values()) {
    registry.addErrorPages(new ErrorPage(httpStatus,
        String.format("/%s/%d", ErrorModule.SERVLET_ERROR_PATH_PREFIX, httpStatus.value())));
  }
}
项目:yum    文件:ErrorPageConfig.java   
@Override
public void registerErrorPages(ErrorPageRegistry registry) {
    registry.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/"));
}
项目:spring-boot-start-current    文件:SpringConfig.java   
@Override
public void registerErrorPages ( ErrorPageRegistry registry ) {
    registry.addErrorPages( new ErrorPage( HttpStatus.NOT_FOUND , "/404.html" ) );
    registry.addErrorPages( new ErrorPage( HttpStatus.UNAUTHORIZED , "/401.html" ) );
    registry.addErrorPages( new ErrorPage( Throwable.class , "/500.html" ) );
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ErrorMvcAutoConfiguration.java   
@Override
public void registerErrorPages(ErrorPageRegistry errorPageRegistry) {
    ErrorPage errorPage = new ErrorPage(this.properties.getServletPrefix()
            + this.properties.getError().getPath());
    errorPageRegistry.addErrorPages(errorPage);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:RemappedErrorViewIntegrationTests.java   
@Override
public void registerErrorPages(ErrorPageRegistry errorPageRegistry) {
    errorPageRegistry.addErrorPages(new ErrorPage("/spring/error"));
}
项目:spring-boot-concourse    文件:ErrorMvcAutoConfiguration.java   
@Override
public void registerErrorPages(ErrorPageRegistry errorPageRegistry) {
    ErrorPage errorPage = new ErrorPage(this.properties.getServletPrefix()
            + this.properties.getError().getPath());
    errorPageRegistry.addErrorPages(errorPage);
}
项目:spring-boot-concourse    文件:RemappedErrorViewIntegrationTests.java   
@Override
public void registerErrorPages(ErrorPageRegistry errorPageRegistry) {
    errorPageRegistry.addErrorPages(new ErrorPage("/spring/error"));
}