/** * @see #addWebapp(String, String) */ public Context addWebapp(Host host, String contextPath, String docBase, ContextConfig config) { Context ctx = createContext(host, contextPath); ctx.setPath(contextPath); ctx.setDocBase(docBase); ctx.addLifecycleListener(new DefaultWebXmlListener()); ctx.setConfigFile(getWebappConfigFile(docBase, contextPath)); ctx.addLifecycleListener(config); // prevent it from looking ( if it finds one - it'll have dup error ) config.setDefaultWebXml(noDefaultWebXmlPath()); // get the host first, creates a new std host if not already set getHost(); // reset ParentClassLoader if (!host.getParentClassLoader().equals(Thread.currentThread().getContextClassLoader())) { host.setParentClassLoader(Thread.currentThread().getContextClassLoader()); } StandardRoot standardRoot = new StandardRoot(ctx); standardRoot.setCacheMaxSize(cacheMaxSize); ctx.setResources(standardRoot); // add the context host.addChild(ctx); return ctx; }
@Override public void lifecycleEvent(LifecycleEvent event) { super.lifecycleEvent(event); if (Lifecycle.BEFORE_START_EVENT.equals(event.getType())) { if (event.getLifecycle() instanceof StandardContext && sessionTimeout > 0) { ((StandardContext) event.getLifecycle()).setSessionTimeout(sessionTimeout); } } } }
/** * @see #addWebapp(String, String) */ public Context addWebapp(Host host, String url, String name, String path) { silence(host, url); Context ctx = new StandardContext(); ctx.setName(name); ctx.setPath(url); ctx.setDocBase(path); ctx.addLifecycleListener(new DefaultWebXmlListener()); ctx.setConfigFile(getWebappConfigFile(path, url)); ContextConfig ctxCfg = new ContextConfig(); ctx.addLifecycleListener(ctxCfg); // prevent it from looking ( if it finds one - it'll have dup error ) ctxCfg.setDefaultWebXml(noDefaultWebXmlPath()); if (host == null) { getHost().addChild(ctx); } else { host.addChild(ctx); } return ctx; }
public Context addWebapp(Host host, String url, String path) { silence(url); Context ctx = new StandardContext(); ctx.setPath( url ); ctx.setDocBase(path); if (defaultRealm == null) { initSimpleAuth(); } ctx.setRealm(defaultRealm); ctx.addLifecycleListener(new DefaultWebXmlListener()); ContextConfig ctxCfg = new ContextConfig(); ctx.addLifecycleListener(ctxCfg); // prevent it from looking ( if it finds one - it'll have dup error ) ctxCfg.setDefaultWebXml("org/apache/catalin/startup/NO_DEFAULT_XML"); if (host == null) { getHost().addChild(ctx); } else { host.addChild(ctx); } return ctx; }
public Context addWebapp(Host host, String url, String path) { silence(url); Context ctx = new StandardContext(); ctx.setPath( url ); ctx.setDocBase(path); if (defaultRealm == null) { initSimpleAuth(); } ctx.setRealm(defaultRealm); ctx.addLifecycleListener(new DefaultWebXmlListener()); ContextConfig ctxCfg = new ContextConfig(); ctx.addLifecycleListener(ctxCfg); // prevent it from looking ( if it finds one - it'll have dup error ) ctxCfg.setDefaultWebXml("org/apache/catalin/startup/NO_DEFAULT_XML"); if (host == null) { getHost().addChild(ctx); } else { host.addChild(ctx); } return ctx; }
@Override public Context addWebapp(Host host, String url, String name, String path) { Context ctx = new StandardContext(); ctx.setName(name); ctx.setPath(url); ctx.setDocBase(path); ctx.addLifecycleListener(new DefaultWebXmlListener()); URL configFile = getWebappConfigFile(path, url); ctx.setConfigFile(configFile); ContextConfig ctxCfg = new TomcatContextConfig(); ctx.addLifecycleListener(ctxCfg); if (host == null) { getHost().addChild(ctx); } else { host.addChild(ctx); } return ctx; }
public Context addWebapp(Host host, String url, String path) { silence(url); Context ctx = new StandardContext(); ctx.setPath( url ); ctx.setDocBase(path); if (defaultRealm == null) { initSimpleAuth(); } ctx.setRealm(defaultRealm); ctx.addLifecycleListener(new DefaultWebXmlListener()); ContextConfig ctxCfg = new ContextConfig(); ctx.addLifecycleListener(ctxCfg); // prevent it from looking ( if it finds one - it'll have dup error ) ctxCfg.setDefaultWebXml("org/apache/catalin/startup/NO_DEFAULT_XML"); if (host == null) { getHost().addChild(ctx); } else { host.addChild(ctx); } return ctx; }
public Context addWebapp(Host host, String url, String name, String path) { silence(host, url); Context ctx = new StandardContext(); ctx.setName(name); ctx.setPath(url); ctx.setDocBase(path); ctx.addLifecycleListener(new DefaultWebXmlListener()); ContextConfig ctxCfg = new ContextConfig(); ctx.addLifecycleListener(ctxCfg); // prevent it from looking ( if it finds one - it'll have dup error ) ctxCfg.setDefaultWebXml(noDefaultWebXmlPath()); if (host == null) { getHost().addChild(ctx); } else { host.addChild(ctx); } return ctx; }
public Context addWebapp(Host host, String url, String name, String path) { silence(host, url); Context ctx = new StandardContext(); ctx.setName(name); ctx.setPath(url); ctx.setDocBase(path); ctx.addLifecycleListener(new DefaultWebXmlListener()); ContextConfig ctxCfg = new ContextConfig(); ctx.addLifecycleListener(ctxCfg); // prevent it from looking ( if it finds one - it'll have dup error ) ctxCfg.setDefaultWebXml(noDefaultWebXmlPath()); if (host == null) { getHost().addChild(ctx); } else { host.addChild(ctx); } return ctx; }
/** * Return a listener that provides the required configuration items for JSP * processing. From the standard Tomcat global web.xml. Pass this to * {@link Context#addLifecycleListener(LifecycleListener)} and then pass the * result of {@link #noDefaultWebXmlPath()} to * {@link ContextConfig#setDefaultWebXml(String)}. * @return a listener object that configures default JSP processing. */ public LifecycleListener getDefaultWebXmlListener() { return new DefaultWebXmlListener(); }
/** * Return a listener that provides the required configuration items for JSP * processing. From the standard Tomcat global web.xml. Pass this to * {@link Context#addLifecycleListener(LifecycleListener)} and then pass the * result of {@link #noDefaultWebXmlPath()} to * {@link ContextConfig#setDefaultWebXml(String)}. * @return a listener object that configures default JSP processing. */ public LifecycleListener getDefaultWebXmlListener() { return new DefaultWebXmlListener(); }
/** * Return a listener that provides the required configuration items for JSP * processing. From the standard Tomcat global web.xml. Pass this to * {@link Context#addLifecycleListener(LifecycleListener)} and then pass the * result of {@link #noDefaultWebXmlPath()} to * {@link ContextConfig#setDefaultWebXml(String)}. * @return a listener object that configures default JSP processing. */ public LifecycleListener getDefaultWebXmlListener() { return new DefaultWebXmlListener(); }
/** * Return a listener that provides the required configuration items for JSP * processing. From the standard Tomcat global web.xml. Pass this to * {@link Context#addLifecycleListener(LifecycleListener)} and then pass the * result of {@link #noDefaultWebXmlPath()} to * {@link ContextConfig#setDefaultWebXml(String)}. * @return a listener object that configures default JSP processing. */ public LifecycleListener getDefaultWebXmlListener() { return new DefaultWebXmlListener(); }
/** * Return a listener that provides the required configuration items for JSP * processing. From the standard Tomcat global web.xml. Pass this to * {@link Context#addLifecycleListener(LifecycleListener)} and then pass the * result of {@link #noDefaultWebXmlPath()} to * {@link ContextConfig#setDefaultWebXml(String)}. * @return a listener object that configures default JSP processing. */ public LifecycleListener getDefaultWebXmlListener() { return new DefaultWebXmlListener(); }