Java 类org.springframework.boot.context.embedded.ErrorPage 实例源码

项目:tinker-manager    文件:WebAppConfig.java   
@Bean
    public EmbeddedServletContainerCustomizer containerCustomizer() {
        return new EmbeddedServletContainerCustomizer() {
            @Override
            public void customize(ConfigurableEmbeddedServletContainer container) {
                ErrorPage page404 = new ErrorPage(HttpStatus.NOT_FOUND,"/404");
                container.addErrorPages(page404);
            }
        };
//        return (container -> {
//            ErrorPage error401Page = new ErrorPage(HttpStatus.UNAUTHORIZED, "/401.html");
//            ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/404.html");
//            ErrorPage error500Page = new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/500.html");
//
//            container.addErrorPages(error401Page, error404Page, error500Page);
//        });
    }
项目:contestparser    文件:TomcatEmbeddedServletContainerFactory.java   
/**
 * Configure the Tomcat {@link Context}.
 * @param context the Tomcat context
 * @param initializers initializers to apply
 */
protected void configureContext(Context context,
        ServletContextInitializer[] initializers) {
    TomcatStarter starter = new TomcatStarter(initializers);
    if (context instanceof TomcatEmbeddedContext) {
        // Should be true
        ((TomcatEmbeddedContext) context).setStarter(starter);
    }
    context.addServletContainerInitializer(starter, NO_CLASSES);
    for (LifecycleListener lifecycleListener : this.contextLifecycleListeners) {
        context.addLifecycleListener(lifecycleListener);
    }
    for (Valve valve : this.contextValves) {
        context.getPipeline().addValve(valve);
    }
    for (ErrorPage errorPage : getErrorPages()) {
        new TomcatErrorPage(errorPage).addToContext(context);
    }
    for (MimeMappings.Mapping mapping : getMimeMappings()) {
        context.addMimeMapping(mapping.getExtension(), mapping.getMimeType());
    }
    configureSession(context);
    for (TomcatContextCustomizer customizer : this.tomcatContextCustomizers) {
        customizer.customize(context);
    }
}
项目:contestparser    文件:TomcatEmbeddedServletContainerFactory.java   
public void addToContext(Context context) {
    Assert.state(this.nativePage != null,
            "Neither Tomcat 7 nor 8 detected so no native error page exists");
    if (ClassUtils.isPresent("org.apache.tomcat.util.descriptor.web.ErrorPage",
            null)) {
        org.apache.tomcat.util.descriptor.web.ErrorPage errorPage = (org.apache.tomcat.util.descriptor.web.ErrorPage) this.nativePage;
        errorPage.setLocation(this.location);
        errorPage.setErrorCode(this.errorCode);
        errorPage.setExceptionType(this.exceptionType);
        context.addErrorPage(errorPage);
    }
    else {
        callMethod(this.nativePage, "setLocation", this.location, String.class);
        callMethod(this.nativePage, "setErrorCode", this.errorCode, int.class);
        callMethod(this.nativePage, "setExceptionType", this.exceptionType,
                String.class);
        callMethod(context, "addErrorPage", this.nativePage,
                this.nativePage.getClass());
    }
}
项目:contestparser    文件:JettyEmbeddedServletContainerFactory.java   
private void addJettyErrorPages(ErrorHandler errorHandler,
        Collection<ErrorPage> errorPages) {
    if (errorHandler instanceof ErrorPageErrorHandler) {
        ErrorPageErrorHandler handler = (ErrorPageErrorHandler) errorHandler;
        for (ErrorPage errorPage : errorPages) {
            if (errorPage.isGlobal()) {
                handler.addErrorPage(ErrorPageErrorHandler.GLOBAL_ERROR_PAGE,
                        errorPage.getPath());
            }
            else {
                if (errorPage.getExceptionName() != null) {
                    handler.addErrorPage(errorPage.getExceptionName(),
                            errorPage.getPath());
                }
                else {
                    handler.addErrorPage(errorPage.getStatusCode(),
                            errorPage.getPath());
                }
            }
        }
    }
}
项目:contestparser    文件:ErrorPageFilterTests.java   
@Test
public void unauthorizedWithErrorPath() throws Exception {
    this.filter.addErrorPages(new ErrorPage("/error"));
    this.chain = new MockFilterChain() {
        @Override
        public void doFilter(ServletRequest request, ServletResponse response)
                throws IOException, ServletException {
            ((HttpServletResponse) response).sendError(401, "UNAUTHORIZED");
            super.doFilter(request, response);
        }
    };
    this.filter.doFilter(this.request, this.response, this.chain);
    assertThat(this.chain.getRequest(), equalTo((ServletRequest) this.request));
    HttpServletResponseWrapper wrapper = (HttpServletResponseWrapper) this.chain
            .getResponse();
    assertThat(wrapper.getResponse(), equalTo((ServletResponse) this.response));
    assertTrue(this.response.isCommitted());
    assertThat(wrapper.getStatus(), equalTo(401));
    // The real response has to be 401 as well...
    assertThat(this.response.getStatus(), equalTo(401));
    assertThat(this.response.getForwardedUrl(), equalTo("/error"));
}
项目:contestparser    文件:ErrorPageFilterTests.java   
@Test
public void globalError() throws Exception {
    this.filter.addErrorPages(new ErrorPage("/error"));
    this.chain = new MockFilterChain() {
        @Override
        public void doFilter(ServletRequest request, ServletResponse response)
                throws IOException, ServletException {
            ((HttpServletResponse) response).sendError(400, "BAD");
            super.doFilter(request, response);
        }
    };
    this.filter.doFilter(this.request, this.response, this.chain);
    assertThat(((HttpServletResponseWrapper) this.chain.getResponse()).getStatus(),
            equalTo(400));
    assertThat(this.request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE),
            equalTo((Object) 400));
    assertThat(this.request.getAttribute(RequestDispatcher.ERROR_MESSAGE),
            equalTo((Object) "BAD"));
    assertThat(this.request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI),
            equalTo((Object) "/test/path"));

    assertTrue(this.response.isCommitted());
    assertThat(this.response.getForwardedUrl(), equalTo("/error"));
}
项目:contestparser    文件:ErrorPageFilterTests.java   
@Test
public void statusError() throws Exception {
    this.filter.addErrorPages(new ErrorPage(HttpStatus.BAD_REQUEST, "/400"));
    this.chain = new MockFilterChain() {
        @Override
        public void doFilter(ServletRequest request, ServletResponse response)
                throws IOException, ServletException {
            ((HttpServletResponse) response).sendError(400, "BAD");
            super.doFilter(request, response);
        }
    };
    this.filter.doFilter(this.request, this.response, this.chain);
    assertThat(((HttpServletResponseWrapper) this.chain.getResponse()).getStatus(),
            equalTo(400));
    assertThat(this.request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE),
            equalTo((Object) 400));
    assertThat(this.request.getAttribute(RequestDispatcher.ERROR_MESSAGE),
            equalTo((Object) "BAD"));
    assertThat(this.request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI),
            equalTo((Object) "/test/path"));
    assertTrue(this.response.isCommitted());
    assertThat(this.response.getForwardedUrl(), equalTo("/400"));
}
项目:contestparser    文件:ErrorPageFilterTests.java   
@Test
public void statusErrorWithCommittedResponse() throws Exception {
    this.filter.addErrorPages(new ErrorPage(HttpStatus.BAD_REQUEST, "/400"));
    this.chain = new MockFilterChain() {
        @Override
        public void doFilter(ServletRequest request, ServletResponse response)
                throws IOException, ServletException {
            ((HttpServletResponse) response).sendError(400, "BAD");
            response.flushBuffer();
            super.doFilter(request, response);
        }
    };
    this.filter.doFilter(this.request, this.response, this.chain);
    assertThat(((HttpServletResponseWrapper) this.chain.getResponse()).getStatus(),
            equalTo(400));
    assertTrue(this.response.isCommitted());
    assertThat(this.response.getForwardedUrl(), is(nullValue()));
}
项目:contestparser    文件:ErrorPageFilterTests.java   
@Test
public void exceptionError() throws Exception {
    this.filter.addErrorPages(new ErrorPage(RuntimeException.class, "/500"));
    this.chain = new MockFilterChain() {
        @Override
        public void doFilter(ServletRequest request, ServletResponse response)
                throws IOException, ServletException {
            super.doFilter(request, response);
            throw new RuntimeException("BAD");
        }
    };
    this.filter.doFilter(this.request, this.response, this.chain);
    assertThat(((HttpServletResponseWrapper) this.chain.getResponse()).getStatus(),
            equalTo(500));
    assertThat(this.request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE),
            equalTo((Object) 500));
    assertThat(this.request.getAttribute(RequestDispatcher.ERROR_MESSAGE),
            equalTo((Object) "BAD"));
    assertThat(this.request.getAttribute(RequestDispatcher.ERROR_EXCEPTION_TYPE),
            equalTo((Object) RuntimeException.class.getName()));
    assertThat(this.request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI),
            equalTo((Object) "/test/path"));
    assertTrue(this.response.isCommitted());
    assertThat(this.response.getForwardedUrl(), equalTo("/500"));
}
项目:contestparser    文件:ErrorPageFilterTests.java   
@Test
public void subClassExceptionError() throws Exception {
    this.filter.addErrorPages(new ErrorPage(RuntimeException.class, "/500"));
    this.chain = new MockFilterChain() {
        @Override
        public void doFilter(ServletRequest request, ServletResponse response)
                throws IOException, ServletException {
            super.doFilter(request, response);
            throw new IllegalStateException("BAD");
        }
    };
    this.filter.doFilter(this.request, this.response, this.chain);
    assertThat(((HttpServletResponseWrapper) this.chain.getResponse()).getStatus(),
            equalTo(500));
    assertThat(this.request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE),
            equalTo((Object) 500));
    assertThat(this.request.getAttribute(RequestDispatcher.ERROR_MESSAGE),
            equalTo((Object) "BAD"));
    assertThat(this.request.getAttribute(RequestDispatcher.ERROR_EXCEPTION_TYPE),
            equalTo((Object) IllegalStateException.class.getName()));
    assertThat(this.request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI),
            equalTo((Object) "/test/path"));
    assertTrue(this.response.isCommitted());
}
项目:contestparser    文件:ErrorPageFilterTests.java   
@Test
public void responseIsCommitedWhenExceptionIsThrownDuringAsyncDispatch()
        throws Exception {
    this.filter.addErrorPages(new ErrorPage("/error"));
    setUpAsyncDispatch();
    this.chain = new MockFilterChain() {
        @Override
        public void doFilter(ServletRequest request, ServletResponse response)
                throws IOException, ServletException {
            super.doFilter(request, response);
            throw new RuntimeException("BAD");
        }
    };
    this.filter.doFilter(this.request, this.response, this.chain);
    assertThat(this.chain.getRequest(), equalTo((ServletRequest) this.request));
    assertThat(((HttpServletResponseWrapper) this.chain.getResponse()).getResponse(),
            equalTo((ServletResponse) this.response));
    assertTrue(this.response.isCommitted());
}
项目:contestparser    文件:ErrorPageFilterTests.java   
@Test
public void responseIsCommitedWhenStatusIs400PlusDuringAsyncDispatch()
        throws Exception {
    this.filter.addErrorPages(new ErrorPage("/error"));
    setUpAsyncDispatch();
    this.chain = new MockFilterChain() {
        @Override
        public void doFilter(ServletRequest request, ServletResponse response)
                throws IOException, ServletException {
            super.doFilter(request, response);
            ((HttpServletResponse) response).sendError(400, "BAD");
        }
    };
    this.filter.doFilter(this.request, this.response, this.chain);
    assertThat(this.chain.getRequest(), equalTo((ServletRequest) this.request));
    assertThat(((HttpServletResponseWrapper) this.chain.getResponse()).getResponse(),
            equalTo((ServletResponse) this.response));
    assertTrue(this.response.isCommitted());
}
项目:contestparser    文件:ErrorPageFilterTests.java   
@Test
public void nestedServletExceptionIsUnwrapped() throws Exception {
    this.filter.addErrorPages(new ErrorPage(RuntimeException.class, "/500"));
    this.chain = new MockFilterChain() {
        @Override
        public void doFilter(ServletRequest request, ServletResponse response)
                throws IOException, ServletException {
            super.doFilter(request, response);
            throw new NestedServletException("Wrapper", new RuntimeException("BAD"));
        }
    };
    this.filter.doFilter(this.request, this.response, this.chain);
    assertThat(((HttpServletResponseWrapper) this.chain.getResponse()).getStatus(),
            equalTo(500));
    assertThat(this.request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE),
            equalTo((Object) 500));
    assertThat(this.request.getAttribute(RequestDispatcher.ERROR_MESSAGE),
            equalTo((Object) "BAD"));
    assertThat(this.request.getAttribute(RequestDispatcher.ERROR_EXCEPTION_TYPE),
            equalTo((Object) RuntimeException.class.getName()));
    assertThat(this.request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI),
            equalTo((Object) "/test/path"));
    assertTrue(this.response.isCommitted());
    assertThat(this.response.getForwardedUrl(), equalTo("/500"));
}
项目:contestparser    文件:EndpointWebMvcChildContextConfiguration.java   
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
    if (this.managementServerProperties == null) {
        this.managementServerProperties = BeanFactoryUtils
                .beanOfTypeIncludingAncestors(this.beanFactory,
                        ManagementServerProperties.class);
        this.server = BeanFactoryUtils.beanOfTypeIncludingAncestors(
                this.beanFactory, ServerProperties.class);
    }
    // Customize as per the parent context first (so e.g. the access logs go to
    // the same place)
    this.server.customize(container);
    // Then reset the error pages
    container.setErrorPages(Collections.<ErrorPage>emptySet());
    // and add the management-specific bits
    container.setPort(this.managementServerProperties.getPort());
    container.setAddress(this.managementServerProperties.getAddress());
    container.addErrorPages(new ErrorPage(this.server.getError().getPath()));
}
项目:uckefu    文件:Application.java   
@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {

    return new EmbeddedServletContainerCustomizer() {
        @Override
        public void customize(ConfigurableEmbeddedServletContainer container) {

            ErrorPage error = new ErrorPage("/error.html");

            container.addErrorPages(error);
        }
    };
}
项目:spring-jdbc-orm    文件:ErrorPageConfig.java   
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
    //404错误页面
    container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/error/notFound"));
    //500错误页面
    container.addErrorPages(new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/error/serverError"));
    //500错误页面
    container.addErrorPages(new ErrorPage(HttpStatus.UNAUTHORIZED, "/unauthorized"));
}
项目:MBLive    文件:WebConfig.java   
@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {
    return new EmbeddedServletContainerCustomizer() {
        @Override
        public void customize(ConfigurableEmbeddedServletContainer container) {
            ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/pageNotFound");
            container.addErrorPages(error404Page);
        }
    };
}
项目:react-practice-web    文件:Launcher.java   
@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {
    return container -> {
        container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/404.html"));
        container.addErrorPages(new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/error.html"));
    };
}
项目:castlemock    文件:ErrorComponent.java   
@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {

    return new EmbeddedServletContainerCustomizer() {
        @Override
        public void customize(ConfigurableEmbeddedServletContainer container) {
            ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/web/error/404");

            container.addErrorPages(error404Page);
        }
    };
}
项目:qianworks-meican    文件:GenericConfig.java   
@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {

    return new EmbeddedServletContainerCustomizer() {
        @Override
        public void customize(ConfigurableEmbeddedServletContainer container) {

            ErrorPage error401Page = new ErrorPage(HttpStatus.UNAUTHORIZED, "/401.html");
            ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/404.html");
            ErrorPage error500Page = new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/500.html");

            container.addErrorPages(error401Page, error404Page, error500Page);
        }
    };
}
项目:spring-boot-sample    文件:ExceptionMvcAutoConfiguration.java   
@Bean
public EmbeddedServletContainerCustomizer containerCustomizer(){
    return new EmbeddedServletContainerCustomizer(){
        @Override
        public void customize(ConfigurableEmbeddedServletContainer container) {
            container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/error/404"));
            container.addErrorPages(new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/error/500"));
            container.addErrorPages(new ErrorPage(java.lang.Throwable.class,"/error/500"));
        }
    };
}
项目:x-pipe    文件:CustomizedConfig.java   
@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {
    return new EmbeddedServletContainerCustomizer() {
        @Override
        public void customize(ConfigurableEmbeddedServletContainer container) {
            ErrorPage error401Page = new ErrorPage(HttpStatus.UNAUTHORIZED, "/401.html");

            container.addErrorPages(error401Page);
        }
    }; 
}
项目:spring-boot-quickstart    文件:Application.java   
@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {
    return new EmbeddedServletContainerCustomizer() {
        @Override
        public void customize(ConfigurableEmbeddedServletContainer container) {
            ErrorPage error401Page = new ErrorPage(HttpStatus.UNAUTHORIZED, "/WEB-INF/views/error/401.jsp");
            ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/WEB-INF/views/error/404.jsp");
            ErrorPage error500Page = new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/WEB-INF/views/error/500.jsp");

            container.addErrorPages(error401Page, error404Page, error500Page);
        }
    };
}
项目:asset    文件:ContainerConfig.java   
@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {

    return container -> {
        //config container paras
        container.setSessionTimeout(24, TimeUnit.HOURS);

        // config error page
        container.addErrorPages(new ErrorPage(HttpStatus.BAD_REQUEST, "/views/400.html"));
        container.addErrorPages(new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/views/500.html"));
        container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/views/400.html"));
    };
}
项目:asset    文件:ContainerConfig.java   
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    TomcatEmbeddedServletContainerFactory factory = new TomcatEmbeddedServletContainerFactory();
    factory.setPort(8080);
    factory.setSessionTimeout(24, TimeUnit.HOURS);

    factory.addErrorPages(new ErrorPage(HttpStatus.BAD_REQUEST, "/views/400.html"));
    factory.addErrorPages(new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/views/500.html"));
    factory.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/views/400.html"));
    return factory;
}
项目:contestparser    文件:ErrorPageFilter.java   
@Override
public void addErrorPages(ErrorPage... errorPages) {
    for (ErrorPage errorPage : errorPages) {
        if (errorPage.isGlobal()) {
            this.global = errorPage.getPath();
        }
        else if (errorPage.getStatus() != null) {
            this.statuses.put(errorPage.getStatus().value(), errorPage.getPath());
        }
        else {
            this.exceptions.put(errorPage.getException(), errorPage.getPath());
        }
    }
}
项目:contestparser    文件:UndertowEmbeddedServletContainerFactory.java   
private io.undertow.servlet.api.ErrorPage getUndertowErrorPage(ErrorPage errorPage) {
    if (errorPage.getStatus() != null) {
        return new io.undertow.servlet.api.ErrorPage(errorPage.getPath(),
                errorPage.getStatusCode());
    }
    if (errorPage.getException() != null) {
        return new io.undertow.servlet.api.ErrorPage(errorPage.getPath(),
                errorPage.getException());
    }
    return new io.undertow.servlet.api.ErrorPage(errorPage.getPath());
}
项目:contestparser    文件:ErrorPageFilterTests.java   
@Test
public void exceptionErrorWithCommittedResponse() throws Exception {
    this.filter.addErrorPages(new ErrorPage(RuntimeException.class, "/500"));
    this.chain = new MockFilterChain() {
        @Override
        public void doFilter(ServletRequest request, ServletResponse response)
                throws IOException, ServletException {
            super.doFilter(request, response);
            response.flushBuffer();
            throw new RuntimeException("BAD");
        }
    };
    this.filter.doFilter(this.request, this.response, this.chain);
    assertThat(this.response.getForwardedUrl(), is(nullValue()));
}
项目:contestparser    文件:UndertowEmbeddedServletContainerFactoryTests.java   
@Test
public void errorPage404() throws Exception {
    AbstractEmbeddedServletContainerFactory factory = getFactory();
    factory.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/hello"));
    this.container = factory.getEmbeddedServletContainer(
            new ServletRegistrationBean(new ExampleServlet(), "/hello"));
    this.container.start();
    assertThat(getResponse(getLocalUrl("/hello")), equalTo("Hello World"));
    assertThat(getResponse(getLocalUrl("/not-found")), equalTo("Hello World"));
}
项目:mywx    文件:Bootstrap.java   
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
    container.addErrorPages(
            new ErrorPage(HttpStatus.BAD_REQUEST, "/error/notfound"),
            new ErrorPage(HttpStatus.NOT_FOUND, "/error/notfound")
    );
}
项目:ConfLab    文件:ConfLabApp.java   
@Bean
public ServerProperties serverProperties() {
    return new ServerProperties() {
        @Override
        public void customize(ConfigurableEmbeddedServletContainer container) {
            super.customize(container);
            container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/404.html"));
        }
    };
}
项目:mandrel    文件:UiServer.java   
@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {
    return container -> {
        container.addErrorPages(new ErrorPage(NotFoundException.class, "/404"), new ErrorPage("/error"));

        MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT);
        mappings.add("eot", "application/vnd.ms-fontobject");
        mappings.add("otf", "application/x-font-opentype");
        mappings.add("ttf", "application/x-font-truetype");
        mappings.add("woff", "application/font-woff");
        mappings.add("woff2", "application/font-woff2");
        mappings.add("svg", "image/svg+xml");
        container.setMimeMappings(mappings);
    };
}
项目:springboot-analysis    文件:MyEmbeddedServletContainerCustomizer.java   
@Override
    public void customize(ConfigurableEmbeddedServletContainer container) {
//        container.setContextPath("/format");
        container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/404.html"));

    }
项目:Spring-Boot-Blog    文件:ErrorPageConfig.java   
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
    container.addErrorPages(new ErrorPage(HttpStatus.FORBIDDEN, "/403"));
    container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/404"));
}
项目:react-boot    文件:WebConfiguration.java   
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
    super.customize(container);
    container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/error/404.html"));
    container.addErrorPages(new ErrorPage("/error/error.html"));
}
项目:contestparser    文件:TomcatEmbeddedServletContainerFactory.java   
TomcatErrorPage(ErrorPage errorPage) {
    this.location = errorPage.getPath();
    this.exceptionType = errorPage.getExceptionName();
    this.errorCode = errorPage.getStatusCode();
    this.nativePage = createNativePage(errorPage);
}
项目:contestparser    文件:UndertowEmbeddedServletContainerFactory.java   
private void configureErrorPages(DeploymentInfo servletBuilder) {
    for (ErrorPage errorPage : getErrorPages()) {
        servletBuilder.addErrorPage(getUndertowErrorPage(errorPage));
    }
}
项目:contestparser    文件:ErrorMvcAutoConfiguration.java   
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
    container.addErrorPages(new ErrorPage(this.properties.getServletPrefix()
            + this.properties.getError().getPath()));
}
项目:contestparser    文件:RemappedErrorViewIntegrationTests.java   
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
    container.addErrorPages(new ErrorPage("/spring/error"));
}
项目:web-harvester    文件:ControllerConfiguration.java   
@Bean public EmbeddedServletContainerCustomizer containerCustomizer() {
    return container -> {
        container.setServerHeader("Harvester Application");
        container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/error/404"),new ErrorPage(HttpStatus.FORBIDDEN, "/error/authentication"));
    };
}