本文整理了Java中org.eclipse.jetty.webapp.WebAppContext.setErrorHandler()
方法的一些代码示例,展示了WebAppContext.setErrorHandler()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebAppContext.setErrorHandler()
方法的具体详情如下:
包路径:org.eclipse.jetty.webapp.WebAppContext
类名称:WebAppContext
方法名:setErrorHandler
暂无
代码示例来源:origin: org.springframework.boot/spring-boot
@Override
public void configure(WebAppContext context) throws Exception {
ErrorHandler errorHandler = context.getErrorHandler();
context.setErrorHandler(new JettyEmbeddedErrorHandler(errorHandler));
addJettyErrorPages(errorHandler, getErrorPages());
}
代码示例来源:origin: org.eclipse.jetty/jetty-webapp
/**
* This constructor is used in the geronimo integration.
*
* @param parent the parent handler
* @param contextPath the context path
* @param sessionHandler SessionHandler for this web app
* @param securityHandler SecurityHandler for this web app
* @param servletHandler ServletHandler for this web app
* @param errorHandler ErrorHandler for this web app
* @param options the options ({@link ServletContextHandler#SESSIONS} and/or {@link ServletContextHandler#SECURITY})
*/
public WebAppContext(HandlerContainer parent, String contextPath, SessionHandler sessionHandler, SecurityHandler securityHandler, ServletHandler servletHandler, ErrorHandler errorHandler,int options)
{
super(parent, contextPath,sessionHandler, securityHandler, servletHandler, errorHandler,options);
_scontext = new Context();
setErrorHandler(errorHandler != null ? errorHandler : new ErrorPageErrorHandler());
setProtectedTargets(__dftProtectedTargets);
}
代码示例来源:origin: gocd/gocd
@Override
public void configure() throws Exception {
server.addEventListener(mbeans());
server.addConnector(plainConnector());
server.addConnector(sslConnector());
ContextHandlerCollection handlers = new ContextHandlerCollection();
deploymentManager.setContexts(handlers);
createWebAppContext();
JettyCustomErrorPageHandler errorHandler = new JettyCustomErrorPageHandler();
webAppContext.setErrorHandler(errorHandler);
webAppContext.setGzipHandler(gzipHandler());
server.addBean(errorHandler);
server.addBean(deploymentManager);
HandlerCollection serverLevelHandlers = new HandlerCollection();
serverLevelHandlers.setHandlers(new Handler[]{handlers});
server.setHandler(serverLevelHandlers);
performCustomConfiguration();
server.setStopAtShutdown(true);
}
代码示例来源:origin: org.unidal.framework/test-framework
public ResourceFallbackWebAppContext() throws Exception {
WebModuleManager manager = new WebModuleManager();
super.setErrorHandler(new ResourceFallbackErrorHandler(manager));
m_manager = manager;
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
public WebAppContext()
{
super(SESSIONS|SECURITY);
_scontext=new Context();
setErrorHandler(new ErrorPageErrorHandler());
setProtectedTargets(__dftProtectedTargets);
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp
public WebAppContext()
{
super(SESSIONS|SECURITY);
_scontext=new Context();
setErrorHandler(new ErrorPageErrorHandler());
setProtectedTargets(__dftProtectedTargets);
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus
public WebAppContext()
{
super(SESSIONS|SECURITY);
_scontext=new Context();
setErrorHandler(new ErrorPageErrorHandler());
setProtectedTargets(__dftProtectedTargets);
}
代码示例来源:origin: com.opentable.components/otj-server-jaxrs
@Bean
Consumer<WebAppContext> webAppContextCustomizer() {
return webAppContext ->
webAppContext.setErrorHandler(new TestErrorHandler());
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
/**
* This constructor is used in the geronimo integration.
*
* @param sessionHandler SessionHandler for this web app
* @param securityHandler SecurityHandler for this web app
* @param servletHandler ServletHandler for this web app
* @param errorHandler ErrorHandler for this web app
*/
public WebAppContext(SessionHandler sessionHandler, SecurityHandler securityHandler, ServletHandler servletHandler, ErrorHandler errorHandler) {
super(null, sessionHandler, securityHandler, servletHandler, errorHandler);
_scontext = new Context();
setErrorHandler(errorHandler != null ? errorHandler : new ErrorPageErrorHandler());
setProtectedTargets(__dftProtectedTargets);
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus
/**
* This constructor is used in the geronimo integration.
*
* @param sessionHandler SessionHandler for this web app
* @param securityHandler SecurityHandler for this web app
* @param servletHandler ServletHandler for this web app
* @param errorHandler ErrorHandler for this web app
*/
public WebAppContext(SessionHandler sessionHandler, SecurityHandler securityHandler, ServletHandler servletHandler, ErrorHandler errorHandler) {
super(null, sessionHandler, securityHandler, servletHandler, errorHandler);
_scontext = new Context();
setErrorHandler(errorHandler != null ? errorHandler : new ErrorPageErrorHandler());
setProtectedTargets(__dftProtectedTargets);
}
代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9
/**
* This constructor is used in the geronimo integration.
*
* @param sessionHandler SessionHandler for this web app
* @param securityHandler SecurityHandler for this web app
* @param servletHandler ServletHandler for this web app
* @param errorHandler ErrorHandler for this web app
*/
public WebAppContext(HandlerContainer parent, String contextPath, SessionHandler sessionHandler, SecurityHandler securityHandler, ServletHandler servletHandler, ErrorHandler errorHandler,int options)
{
super(parent, contextPath,sessionHandler, securityHandler, servletHandler, errorHandler,options);
_scontext = new Context();
setErrorHandler(errorHandler != null ? errorHandler : new ErrorPageErrorHandler());
setProtectedTargets(__dftProtectedTargets);
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp
/**
* This constructor is used in the geronimo integration.
*
* @param sessionHandler SessionHandler for this web app
* @param securityHandler SecurityHandler for this web app
* @param servletHandler ServletHandler for this web app
* @param errorHandler ErrorHandler for this web app
*/
public WebAppContext(SessionHandler sessionHandler, SecurityHandler securityHandler, ServletHandler servletHandler, ErrorHandler errorHandler) {
super(null, sessionHandler, securityHandler, servletHandler, errorHandler);
_scontext = new Context();
setErrorHandler(errorHandler != null ? errorHandler : new ErrorPageErrorHandler());
setProtectedTargets(__dftProtectedTargets);
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
/**
* This constructor is used in the geronimo integration.
*
* @param sessionHandler SessionHandler for this web app
* @param securityHandler SecurityHandler for this web app
* @param servletHandler ServletHandler for this web app
* @param errorHandler ErrorHandler for this web app
*/
public WebAppContext(HandlerContainer parent, String contextPath, SessionHandler sessionHandler, SecurityHandler securityHandler, ServletHandler servletHandler, ErrorHandler errorHandler,int options)
{
super(parent, contextPath,sessionHandler, securityHandler, servletHandler, errorHandler,options);
_scontext = new Context();
setErrorHandler(errorHandler != null ? errorHandler : new ErrorPageErrorHandler());
setProtectedTargets(__dftProtectedTargets);
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus
/**
* @param parent The parent HandlerContainer.
* @param contextPath The context path
* @param webApp The URL or filename of the webapp directory or war file.
*/
public WebAppContext(HandlerContainer parent, String webApp, String contextPath)
{
super(parent,contextPath,SESSIONS|SECURITY);
_scontext=new Context();
setWar(webApp);
setErrorHandler(new ErrorPageErrorHandler());
setProtectedTargets(__dftProtectedTargets);
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp
/**
* @param parent The parent HandlerContainer.
* @param contextPath The context path
* @param webApp The URL or filename of the webapp directory or war file.
*/
public WebAppContext(HandlerContainer parent, String webApp, String contextPath)
{
super(parent,contextPath,SESSIONS|SECURITY);
_scontext=new Context();
setWar(webApp);
setErrorHandler(new ErrorPageErrorHandler());
setProtectedTargets(__dftProtectedTargets);
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
/**
* @param parent The parent HandlerContainer.
* @param contextPath The context path
* @param webApp The URL or filename of the webapp directory or war file.
*/
public WebAppContext(HandlerContainer parent, String webApp, String contextPath)
{
super(parent,contextPath,SESSIONS|SECURITY);
_scontext=new Context();
setWar(webApp);
setErrorHandler(new ErrorPageErrorHandler());
setProtectedTargets(__dftProtectedTargets);
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp
/**
* @param contextPath The context path
* @param webApp The URL or filename of the webapp directory or war file.
*/
public WebAppContext(String webApp,String contextPath)
{
super(null,contextPath,SESSIONS|SECURITY);
_scontext=new Context();
setContextPath(contextPath);
setWar(webApp);
setErrorHandler(new ErrorPageErrorHandler());
setProtectedTargets(__dftProtectedTargets);
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
/**
* @param contextPath The context path
* @param webApp The URL or filename of the webapp directory or war file.
*/
public WebAppContext(String webApp,String contextPath)
{
super(null,contextPath,SESSIONS|SECURITY);
_scontext=new Context();
setContextPath(contextPath);
setWar(webApp);
setErrorHandler(new ErrorPageErrorHandler());
setProtectedTargets(__dftProtectedTargets);
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus
/**
* @param contextPath The context path
* @param webApp The URL or filename of the webapp directory or war file.
*/
public WebAppContext(String webApp,String contextPath)
{
super(null,contextPath,SESSIONS|SECURITY);
_scontext=new Context();
setContextPath(contextPath);
setWar(webApp);
setErrorHandler(new ErrorPageErrorHandler());
setProtectedTargets(__dftProtectedTargets);
}
代码示例来源:origin: shunyang/thrift-all
private HandlerCollection createHandlers() {
WebAppContext context = new WebAppContext();
context.setContextPath(contextPath);
context.setWar(webDir);
context.setTempDirectory(new File(tempDir));
ErrorPageErrorHandler errorPage = new ErrorPageErrorHandler();
errorPage.addErrorPage(404,"/404");
context.setErrorHandler(errorPage);
RequestLogHandler logHandler = new RequestLogHandler();
logHandler.setRequestLog(createRequestLog());
HandlerCollection handlerCollection = new HandlerCollection();
handlerCollection.setHandlers(new Handler[]{context, logHandler});
return handlerCollection;
}
内容来源于网络,如有侵权,请联系作者删除!