@Override public void deconfigure (WebAppContext context) throws Exception { context.setWelcomeFiles(null); if (context.getErrorHandler() instanceof ErrorPageErrorHandler) ((ErrorPageErrorHandler) context.getErrorHandler()).setErrorPages(null); // TODO remove classpaths from classloader } }
@Override public void configure(WebAppContext context) throws Exception { ErrorHandler errorHandler = context.getErrorHandler(); context.setErrorHandler(new JettyEmbeddedErrorHandler(errorHandler)); addJettyErrorPages(errorHandler, getErrorPages()); }
@Test public void shouldSetErrorHandlerForWebAppContext() throws Exception { jetty9Server.configure(); jetty9Server.startHandlers(); WebAppContext webAppContext = (WebAppContext) getLoadedHandlers().get(WebAppContext.class); assertThat(webAppContext.getErrorHandler() instanceof JettyCustomErrorPageHandler, is(true)); }
if (!location.startsWith("/")) throw new IllegalStateException("Missing leading '/' for location: " + location); ErrorPageErrorHandler handler = (ErrorPageErrorHandler)context.getErrorHandler(); String originName = "error."+error; switch (context.getMetaData().getOrigin(originName))
@Override public void deconfigure (WebAppContext context) throws Exception { context.setWelcomeFiles(null); if (context.getErrorHandler() instanceof ErrorPageErrorHandler) ((ErrorPageErrorHandler) context.getErrorHandler()).setErrorPages(null); // TODO remove classpaths from classloader } }
@Override public void deconfigure (WebAppContext context) throws Exception { ServletHandler _servletHandler = context.getServletHandler(); context.setWelcomeFiles(null); if (context.getErrorHandler() instanceof ErrorPageErrorHandler) ((ErrorPageErrorHandler) context.getErrorHandler()).setErrorPages(null); // TODO remove classpaths from classloader } }
@Override public void deconfigure (WebAppContext context) throws Exception { ServletHandler _servletHandler = context.getServletHandler(); context.setWelcomeFiles(null); if (context.getErrorHandler() instanceof ErrorPageErrorHandler) ((ErrorPageErrorHandler) context.getErrorHandler()).setErrorPages(null); // TODO remove classpaths from classloader } }
@Override public void deconfigure (WebAppContext context) throws Exception { ServletHandler _servletHandler = context.getServletHandler(); context.setWelcomeFiles(null); if (context.getErrorHandler() instanceof ErrorPageErrorHandler) ((ErrorPageErrorHandler) context.getErrorHandler()).setErrorPages(null); // TODO remove classpaths from classloader } }
public TWebServer duplicateContext(String existsContextPath,String duplicateContextPath) throws IllegalStateException{ WebAppContext context = contexts.get(existsContextPath); if(null == context){ throw new IllegalStateException("The given argument [existsContextPath] '" + existsContextPath + "' not exists"); } if(contexts.containsKey(duplicateContextPath)){ throw new IllegalStateException("The given argument [duplicateContextPath] '" + duplicateContextPath + "' aleady exists"); } WebAppContext duplicateContext = new WebAppContext(); duplicateContext.setContextPath(duplicateContextPath); duplicateContext.setClassLoader(context.getClassLoader()); duplicateContext.setParentLoaderPriority(context.isParentLoaderPriority()); duplicateContext.setServer(server); duplicateContext.setErrorHandler(context.getErrorHandler()); duplicateContext.setBaseResource(context.getBaseResource()); duplicateContext.setThrowUnavailableOnStartupException(context.isThrowUnavailableOnStartupException()); contexts.put(duplicateContextPath, duplicateContext); return this; }
@Override public void deconfigure (WebAppContext context) throws Exception { // TODO preserve any configuration that pre-existed. ServletHandler _servletHandler = context.getServletHandler(); _servletHandler.setFilters(null); _servletHandler.setFilterMappings(null); _servletHandler.setServlets(null); _servletHandler.setServletMappings(null); context.setEventListeners(null); context.setWelcomeFiles(null); if (context.getErrorHandler() instanceof ErrorPageErrorHandler) ((ErrorPageErrorHandler) context.getErrorHandler()).setErrorPages(null); // TODO remove classpaths from classloader } }
@Override public void deconfigure (WebAppContext context) throws Exception { // TODO preserve any configuration that pre-existed. ServletHandler _servletHandler = context.getServletHandler(); _servletHandler.setFilters(null); _servletHandler.setFilterMappings(null); _servletHandler.setServlets(null); _servletHandler.setServletMappings(null); context.setEventListeners(null); context.setWelcomeFiles(null); if (context.getErrorHandler() instanceof ErrorPageErrorHandler) ((ErrorPageErrorHandler) context.getErrorHandler()).setErrorPages(null); // TODO remove classpaths from classloader } }
if (!location.startsWith("/")) throw new IllegalStateException("Missing leading '/' for location: " + location); ErrorPageErrorHandler handler = (ErrorPageErrorHandler)context.getErrorHandler(); String originName = "error."+error; switch (context.getMetaData().getOrigin(originName))
ErrorPageErrorHandler handler = (ErrorPageErrorHandler)context.getErrorHandler(); Origin o = context.getMetaData().getOrigin("error."+error);
ErrorPageErrorHandler handler = (ErrorPageErrorHandler)context.getErrorHandler(); Origin o = context.getMetaData().getOrigin("error."+error);
ErrorPageErrorHandler handler = (ErrorPageErrorHandler)context.getErrorHandler();
ErrorPageErrorHandler handler = (ErrorPageErrorHandler)context.getErrorHandler();
ErrorPageErrorHandler handler = (ErrorPageErrorHandler)context.getErrorHandler(); Origin o = context.getMetaData().getOrigin("error."+error);
Map<String,String> errorPages = ((ErrorPageErrorHandler)_webApp.getErrorHandler()).getErrorPages(); if (errorPages != null)