@Override public void lifecycleEvent(LifecycleEvent event) { if (Lifecycle.BEFORE_START_EVENT.equals(event.getType())) { initWebappDefaults((Context) event.getLifecycle()); } } }
/** * Override to apply the equivalent of the stock "$CATALINA_BASE/conf/web.xml" to contexts programmatically. */ @Override protected synchronized void beforeStart() { super.beforeStart(); ((StandardContext) context).setJ2EEServer("Arquillian-" + UUID.randomUUID().toString()); Tomcat.initWebappDefaults(context); }
@Override public void lifecycleEvent(LifecycleEvent event) { if (Lifecycle.BEFORE_START_EVENT.equals(event.getType())) { initWebappDefaults((Context) event.getLifecycle()); } } }
@Override public void lifecycleEvent(LifecycleEvent event) { if (Lifecycle.BEFORE_START_EVENT.equals(event.getType())) { initWebappDefaults((Context) event.getLifecycle()); } } }
public void lifecycleEvent(LifecycleEvent event) { if (Lifecycle.BEFORE_START_EVENT.equals(event.getType())) { initWebappDefaults((Context) event.getLifecycle()); } } }
@Override public void lifecycleEvent(LifecycleEvent event) { if (Lifecycle.BEFORE_START_EVENT.equals(event.getType())) { initWebappDefaults((Context) event.getLifecycle()); } } }
@Override public void lifecycleEvent(LifecycleEvent event) { if (Lifecycle.BEFORE_START_EVENT.equals(event.getType())) { initWebappDefaults((Context) event.getLifecycle()); } } }
public void lifecycleEvent(LifecycleEvent event) { if (Lifecycle.BEFORE_START_EVENT.equals(event.getType())) { initWebappDefaults((Context) event.getLifecycle()); } } }
public void lifecycleEvent(LifecycleEvent event) { if (Lifecycle.BEFORE_START_EVENT.equals(event.getType())) { initWebappDefaults((Context) event.getLifecycle()); } } }
/** * Provide default configuration for a context. This is the programmatic * equivalent of the default web.xml. * * TODO: in normal Tomcat, if default-web.xml is not found, use this * method * * @param contextPath The context to set the defaults for */ public void initWebappDefaults(String contextPath) { Container ctx = getHost().findChild(contextPath); initWebappDefaults((Context) ctx); }
/** * Provide default configuration for a context. This is the programmatic * equivalent of the default web.xml. * * TODO: in normal Tomcat, if default-web.xml is not found, use this * method * * @param contextPath The context to set the defaults for */ public void initWebappDefaults(String contextPath) { Container ctx = getHost().findChild(contextPath); initWebappDefaults((Context) ctx); }
/** * Provide default configuration for a context. This is the programmatic * equivalent of the default web.xml. * * TODO: in normal Tomcat, if default-web.xml is not found, use this * method * * @param contextPath The context to set the defaults for */ public void initWebappDefaults(String contextPath) { Container ctx = getHost().findChild(contextPath); initWebappDefaults((Context) ctx); }
/** * Provide default configuration for a context. This is the programmatic * equivalent of the default web.xml. * * TODO: in normal Tomcat, if default-web.xml is not found, use this * method * * @param contextPath The context to set the defaults for */ public void initWebappDefaults(String contextPath) { Container ctx = getHost().findChild(contextPath); initWebappDefaults((Context) ctx); }
/** * Provide default configuration for a context. This is the programmatic * equivalent of the default web.xml. * * TODO: in normal Tomcat, if default-web.xml is not found, use this * method * * @param contextPath The context to set the defaults for */ public void initWebappDefaults(String contextPath) { Container ctx = getHost().findChild(contextPath); initWebappDefaults((Context) ctx); }
/** * Provide default configuration for a context. This is the programmatic * equivalent of the default web.xml. * * TODO: in normal Tomcat, if default-web.xml is not found, use this * method * * @param contextPath The context to set the defaults for */ public void initWebappDefaults(String contextPath) { Container ctx = getHost().findChild(contextPath); initWebappDefaults((Context) ctx); }
/** * Provide default configuration for a context. This is the programmatic * equivalent of the default web.xml. * * TODO: in normal Tomcat, if default-web.xml is not found, use this * method * * @param contextPath The context to set the defaults for */ public void initWebappDefaults(String contextPath) { Container ctx = getHost().findChild(contextPath); initWebappDefaults((Context) ctx); }
/** * Provide default configuration for a context. This is the programmatic * equivalent of the default web.xml. * * TODO: in normal Tomcat, if default-web.xml is not found, use this * method * * @param contextPath The context to set the defaults for */ public void initWebappDefaults(String contextPath) { Container ctx = getHost().findChild(contextPath); initWebappDefaults((Context) ctx); }
private void createStaticContext( final Tomcat container, Context context, Host host ) { if ( staticContextDocbase != null ) { Context staticContext = container.addContext( staticContextPath, staticContextDocbase ); Tomcat.initWebappDefaults(staticContext); staticContext.setPrivileged( true ); Wrapper servlet = context.createWrapper(); servlet.setServletClass( DefaultServlet.class.getName() ); servlet.setName( "staticContent" ); staticContext.addChild( servlet ); staticContext.addServletMapping( "/", "staticContent" ); // see https://issues.apache.org/jira/browse/MTOMCAT-238 //host.addChild( staticContext ); } }
Tomcat.initWebappDefaults(context);