当前位置: 首页>>代码示例>>Java>>正文


Java ConfigurableEmbeddedServletContainer.addErrorPages方法代码示例

本文整理汇总了Java中org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer.addErrorPages方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigurableEmbeddedServletContainer.addErrorPages方法的具体用法?Java ConfigurableEmbeddedServletContainer.addErrorPages怎么用?Java ConfigurableEmbeddedServletContainer.addErrorPages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer的用法示例。

在下文中一共展示了ConfigurableEmbeddedServletContainer.addErrorPages方法的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@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 the context path
	container.setContextPath("");
	// and add the management-specific bits
	container.setPort(this.managementServerProperties.getPort());
	if (this.managementServerProperties.getSsl() != null) {
		container.setSsl(this.managementServerProperties.getSsl());
	}
	container.setServerHeader(this.server.getServerHeader());
	container.setAddress(this.managementServerProperties.getAddress());
	container.addErrorPages(new ErrorPage(this.server.getError().getPath()));
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:26,代码来源:EndpointWebMvcChildContextConfiguration.java


示例2: containerCustomizer

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@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);
//        });
    }
 
开发者ID:baidao,项目名称:tinker-manager,代码行数:18,代码来源:WebAppConfig.java


示例3: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@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 the context path
	container.setContextPath("");
	// and add the management-specific bits
	container.setPort(this.managementServerProperties.getPort());
	container.setServerHeader(this.server.getServerHeader());
	container.setAddress(this.managementServerProperties.getAddress());
	container.addErrorPages(new ErrorPage(this.server.getError().getPath()));
}
 
开发者ID:philwebb,项目名称:spring-boot-concourse,代码行数:23,代码来源:EndpointWebMvcChildContextConfiguration.java


示例4: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@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()));
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:20,代码来源:EndpointWebMvcChildContextConfiguration.java


示例5: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
    super.customize(container);

    container.addErrorPages(new ErrorPage(HttpStatus.UNAUTHORIZED,
            "/error/401"));
    container.addErrorPages(new ErrorPage(HttpStatus.FORBIDDEN,
            "/error/403"));
    container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND,
            "/error/404"));
    container.addErrorPages(new ErrorPage(HttpStatus.GONE,
            "/error/410"));
    container.addErrorPages(new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR,
            "/error"));

    container.setSessionTimeout(sessionTimeout, TimeUnit.MINUTES);
}
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:18,代码来源:MidPointSpringApplication.java


示例6: containerCustomizer

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {

  return new EmbeddedServletContainerCustomizer() {
    @Override
    public void customize(ConfigurableEmbeddedServletContainer container) {
      ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/404.html");
      container.addErrorPages(error404Page);
    }
  };
}
 
开发者ID:tomoya92,项目名称:pyblog,代码行数:12,代码来源:WebConfig.java


示例7: containerCustomizer

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {

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

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

            container.addErrorPages(error);
        }
    };
}
 
开发者ID:uckefu,项目名称:uckefu,代码行数:14,代码来源:Application.java


示例8: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
    ErrorPage error400Page = new ErrorPage(HttpStatus.BAD_REQUEST, "/400.html");
    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(error400Page, error401Page, error404Page, error500Page);
}
 
开发者ID:fengzhizi715,项目名称:ProxyPool,代码行数:10,代码来源:ErrorPageConfig.java


示例9: containerCustomizer

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {

    return new EmbeddedServletContainerCustomizer() {
        @Override
        public void customize(ConfigurableEmbeddedServletContainer container) {
            ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/404");
            ErrorPage error500Page = new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/500");
            container.addErrorPages(error404Page);
            container.addErrorPages(error500Page);
        }
    };
}
 
开发者ID:egojit8,项目名称:easyweb,代码行数:14,代码来源:WebConfig.java


示例10: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@Override
public void customize(ConfigurableEmbeddedServletContainer configurableEmbeddedServletContainer) {
	configurableEmbeddedServletContainer.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/error404"));
	configurableEmbeddedServletContainer.addErrorPages(new ErrorPage(HttpStatus.FORBIDDEN, "/error403"));

	Compression compression = new Compression();
	compression.setEnabled(true);

	compression.setMimeTypes(mimeTypes);
	configurableEmbeddedServletContainer.setCompression(compression);
}
 
开发者ID:allianzit,项目名称:ait-platform,代码行数:12,代码来源:AitTomcatCustomizer.java


示例11: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@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"));
}
 
开发者ID:egzosn,项目名称:spring-jdbc-orm,代码行数:10,代码来源:ErrorPageConfig.java


示例12: containerCustomizer

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {
    return new EmbeddedServletContainerCustomizer() {
        @Override
        public void customize(ConfigurableEmbeddedServletContainer container) {
            ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/pageNotFound");
            container.addErrorPages(error404Page);
        }
    };
}
 
开发者ID:fku233,项目名称:MBLive,代码行数:11,代码来源:WebConfig.java


示例13: containerCustomizer

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@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);
        }
    };
}
 
开发者ID:castlemock,项目名称:castlemock,代码行数:13,代码来源:ErrorComponent.java


示例14: containerCustomizer

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@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);
        }
    };
}
 
开发者ID:QianWorks,项目名称:qianworks-meican,代码行数:16,代码来源:GenericConfig.java


示例15: containerCustomizer

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@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"));
		}
	};
}
 
开发者ID:whatlookingfor,项目名称:spring-boot-sample,代码行数:12,代码来源:ExceptionMvcAutoConfiguration.java


示例16: containerCustomizer

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {
	return new EmbeddedServletContainerCustomizer() {
		@Override
		public void customize(ConfigurableEmbeddedServletContainer container) {
			ErrorPage error401Page = new ErrorPage(HttpStatus.UNAUTHORIZED, "/401.html");
			
			container.addErrorPages(error401Page);
		}
	}; 
}
 
开发者ID:ctripcorp,项目名称:x-pipe,代码行数:12,代码来源:CustomizedConfig.java


示例17: containerCustomizer

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@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);
        }
    };
}
 
开发者ID:fireshort,项目名称:spring-boot-quickstart,代码行数:14,代码来源:Application.java


示例18: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
    container.addErrorPages(
            new ErrorPage(HttpStatus.BAD_REQUEST, "/error/notfound"),
            new ErrorPage(HttpStatus.NOT_FOUND, "/error/notfound")
    );
}
 
开发者ID:cyzaoj,项目名称:mywx,代码行数:8,代码来源:Bootstrap.java


示例19: serverProperties

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@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"));
        }
    };
}
 
开发者ID:vitalii-dmytruk,项目名称:ConfLab,代码行数:11,代码来源:ConfLabApp.java


示例20: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
	container.addErrorPages(new ErrorPage(HttpStatus.FORBIDDEN, "/403"));
}
 
开发者ID:514840279,项目名称:danyuan-application,代码行数:5,代码来源:ErrorPageConfig.java


示例21: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
    container.setPort(9090);
    container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND,"/404.html"));
    container.setSessionTimeout(10, TimeUnit.MINUTES);
}
 
开发者ID:shuaishuaila,项目名称:java_springboot,代码行数:7,代码来源:CustomServletContainer.java


示例22: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@Override
    public void customize(ConfigurableEmbeddedServletContainer container) {
//        container.setContextPath("/format");
        container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/404.html"));

    }
 
开发者ID:fangjian0423,项目名称:springboot-analysis,代码行数:7,代码来源:MyEmbeddedServletContainerCustomizer.java


示例23: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
    container.addErrorPages(new ErrorPage(HttpStatus.FORBIDDEN, "/403"));
    container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/404"));
}
 
开发者ID:sheepmen,项目名称:Spring-Boot-Blog,代码行数:6,代码来源:ErrorPageConfig.java


示例24: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
    container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/"));
}
 
开发者ID:jaxio,项目名称:celerio-angular-quickstart,代码行数:5,代码来源:Application.java


示例25: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@Override
public void customize(ConfigurableEmbeddedServletContainer configurableEmbeddedServletContainer) {
	configurableEmbeddedServletContainer.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/404.html"));
}
 
开发者ID:reportportal,项目名称:service-gateway,代码行数:5,代码来源:GatewayApp.java


示例26: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@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"));
}
 
开发者ID:create1st,项目名称:react-boot,代码行数:7,代码来源:WebConfiguration.java


示例27: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
	container.addErrorPages(new ErrorPage(this.properties.getServletPrefix()
			+ this.properties.getError().getPath()));
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:6,代码来源:ErrorMvcAutoConfiguration.java


示例28: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
	container.addErrorPages(new ErrorPage("/spring/error"));
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:5,代码来源:RemappedErrorViewIntegrationTests.java


示例29: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
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"));
}
 
开发者ID:sercxtyf,项目名称:onboard,代码行数:7,代码来源:Application.java


示例30: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //导入方法依赖的package包/类
/**
 * Define error page
 *
 * @param container servlet container
 */
@Override
public void customize(final ConfigurableEmbeddedServletContainer container) {
    container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/404"));
}
 
开发者ID:mhaddon,项目名称:Sound.je,代码行数:10,代码来源:ErrorConfig.java



注:本文中的org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer.addErrorPages方法示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。