public void setConfigurationClasses(List<String> configurations) { setConfigurationClasses(configurations.toArray(new String[configurations.size()])); }
private WebAppContext createWebAppContext() { webAppContext = new WebAppContext(); webAppContext.setDefaultsDescriptor(GoWebXmlConfiguration.configuration(getWarFile())); webAppContext.setConfigurationClasses(new String[]{ WebInfConfiguration.class.getCanonicalName(), WebXmlConfiguration.class.getCanonicalName(), JettyWebXmlConfiguration.class.getCanonicalName() }); webAppContext.setContextPath(systemEnvironment.getWebappContextPath()); // delegate all logging to parent classloader to avoid initialization of loggers in multiple classloaders webAppContext.addSystemClass("org.apache.log4j."); webAppContext.addSystemClass("org.slf4j."); webAppContext.addSystemClass("org.apache.commons.logging."); webAppContext.setWar(getWarFile()); webAppContext.setParentLoaderPriority(systemEnvironment.getParentLoaderPriority()); return webAppContext; }
public void setConfigurationClasses(List<String> configurations) { setConfigurationClasses(configurations.toArray(new String[configurations.size()])); }
public void setConfigurationClasses(List<String> configurations) { setConfigurationClasses(configurations.toArray(new String[configurations.size()])); }
public void setConfigurationClasses(List<String> configurations) { setConfigurationClasses(configurations.toArray(new String[configurations.size()])); }
@Override public void setServer(Server server) { super.setServer(server); //if we haven't been given a set of configuration instances to //use, and we haven't been given a set of configuration classes //to use, use the configuration classes that came from the //Server (if there are any) if (!_configurationsSet && !_configurationClassesSet && server != null) { String[] serverConfigs = (String[])server.getAttribute(SERVER_CONFIG); if (serverConfigs != null) setConfigurationClasses(serverConfigs); } }
@Override public void setServer(Server server) { super.setServer(server); //if we haven't been given a set of configuration instances to //use, and we haven't been given a set of configuration classes //to use, use the configuration classes that came from the //Server (if there are any) if (!_configurationsSet && !_configurationClassesSet && server != null) { String[] serverConfigs = (String[])server.getAttribute(SERVER_CONFIG); if (serverConfigs != null) setConfigurationClasses(serverConfigs); } }
@Override public void setServer(Server server) { super.setServer(server); //if we haven't been given a set of configuration instances to //use, and we haven't been given a set of configuration classes //to use, use the configuration classes that came from the //Server (if there are any) if (!_configurationsSet && !_configurationClassesSet && server != null) { String[] serverConfigs = (String[])server.getAttribute(SERVER_CONFIG); if (serverConfigs != null) setConfigurationClasses(serverConfigs); } }
String[] configurationClasses = { "org.eclipse.jetty.webapp.WebInfConfiguration", "org.eclipse.jetty.webapp.WebXmlConfiguration", "org.eclipse.jetty.webapp.MetaInfConfiguration", "org.eclipse.jetty.webapp.FragmentConfiguration", "org.eclipse.jetty.plus.webapp.EnvConfiguration", "org.eclipse.jetty.webapp.JettyWebXmlConfiguration" }; WebAppContext webapp = new WebAppContext(); webapp.setConfigurationClasses(configurationClasses); webapp.setDescriptor("/path/to/webapp/WEB-INF/web.xml"); webapp.setContextPath("/"); webapp.setResourceBase("/path/to/webapp"); webapp.setClassLoader(Thread.currentThread().getContextClassLoader());
context.setConfigurationClasses(getConfigurationClasses( preScanned ? JETTY_CONFIGURATION_CLASSES_PRESCANNED : JETTY_CONFIGURATION_CLASSES));
context.setConfigurationClasses(getConfigurationClasses(JETTY_CONFIGURATION_CLASSES));
if (_configurationClasses != null) wah.setConfigurationClasses(_configurationClasses);
protected void initializeWebAppContextDefaults(WebAppContext webapp) { if (_defaultsDescriptor != null) webapp.setDefaultsDescriptor(_defaultsDescriptor); webapp.setExtractWAR(_extractWars); webapp.setParentLoaderPriority(_parentLoaderPriority); if (_configurationClasses != null) webapp.setConfigurationClasses(_configurationClasses); if (_tempDirectory != null) { /* Since the Temp Dir is really a context base temp directory, * Lets set the Temp Directory in a way similar to how WebInfConfiguration does it, * instead of setting the WebAppContext.setTempDirectory(File). * If we used .setTempDirectory(File) all webapps will wind up in the * same temp / work directory, overwriting each others work. */ webapp.setAttribute(WebAppContext.BASETEMPDIR, _tempDirectory); } }
if (useWebXml) webapp.setConfigurationClasses(WebAppContext.getDefaultConfigurationClasses());
webapp.setConfigurationClasses( configClasses );
if (_configurationClasses != null) wah.setConfigurationClasses(_configurationClasses);
if (_configurationClasses != null) wah.setConfigurationClasses(_configurationClasses);
wah.setConfigurationClasses(_configurationClasses); if (_defaultsDescriptor!=null) wah.setDefaultsDescriptor(_defaultsDescriptor);
wah.setConfigurationClasses(getConfigurationClasses());
wctx.setConfigurationClasses(webappConfigurationClasses);