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

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

源代码1 项目: 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);
//        });
    }
 
源代码2 项目: 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);
		}
	}; 
}
 
源代码3 项目: 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);
        }
    };
}
 
源代码4 项目: jee-universal-bms   文件: WebConfig.java
@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {
    return new EmbeddedServletContainerCustomizer() {
        @Override
        public void customize(ConfigurableEmbeddedServletContainer container) {

            ErrorPage error403Page = new ErrorPage(HttpStatus.FORBIDDEN, "/403.html");
            ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/404.html");
            ErrorPage error405Page = new ErrorPage(HttpStatus.METHOD_NOT_ALLOWED, "/405.html");
            ErrorPage error500Page = new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/500.html");

            container.addErrorPages(error403Page, error404Page, error405Page, error500Page);
        }
    };
}
 
源代码5 项目: 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")
    );
}
 
源代码6 项目: 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"));
}
 
源代码7 项目: onboard   文件: Application.java
public void customize(ConfigurableEmbeddedServletContainer container) {
    container.addErrorPages(new ErrorPage(HttpStatus.BAD_REQUEST, "/error/404"));
    container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/error/404"));
    container.addErrorPages(new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/error/500"));
    container.addErrorPages(new ErrorPage(HttpStatus.FORBIDDEN, "/error/403"));
}
 
 类所在包
 类方法
 同包方法