本文整理了Java中org.eclipse.jetty.webapp.WebAppContext.setDefaultsDescriptor()
方法的一些代码示例,展示了WebAppContext.setDefaultsDescriptor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebAppContext.setDefaultsDescriptor()
方法的具体详情如下:
包路径:org.eclipse.jetty.webapp.WebAppContext
类名称:WebAppContext
方法名:setDefaultsDescriptor
[英]The default descriptor is a web.xml format file that is applied to the context before the standard WEB-INF/web.xml
[中]默认描述符是web。应用于标准WEB-INF/WEB之前的上下文的xml格式文件。xml
代码示例来源:origin: apache/nifi
serverClasses.remove("org.slf4j.");
webappContext.setServerClasses(serverClasses.toArray(new String[0]));
webappContext.setDefaultsDescriptor(WEB_DEFAULTS_XML);
代码示例来源:origin: gocd/gocd
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;
}
代码示例来源:origin: org.apache.hadoop/hadoop-common
private static WebAppContext createWebAppContext(Builder b,
AccessControlList adminsAcl, final String appDir) {
WebAppContext ctx = new WebAppContext();
ctx.setDefaultsDescriptor(null);
ServletHolder holder = new ServletHolder(new DefaultServlet());
Map<String, String> params = ImmutableMap. <String, String> builder()
.put("acceptRanges", "true")
.put("dirAllowed", "false")
.put("gzip", "true")
.put("useFileMappedBuffer", "true")
.build();
holder.setInitParameters(params);
ctx.setWelcomeFiles(new String[] {"index.html"});
ctx.addServlet(holder, "/");
ctx.setDisplayName(b.name);
ctx.setContextPath("/");
ctx.setWar(appDir + "/" + b.name);
String tempDirectory = b.conf.get(HTTP_TEMP_DIR_KEY);
if (tempDirectory != null && !tempDirectory.isEmpty()) {
ctx.setTempDirectory(new File(tempDirectory));
ctx.setAttribute("javax.servlet.context.tempdir", tempDirectory);
}
ctx.getServletContext().setAttribute(CONF_CONTEXT_ATTRIBUTE, b.conf);
ctx.getServletContext().setAttribute(ADMINS_ACL, adminsAcl);
addNoCacheFilter(ctx);
return ctx;
}
代码示例来源:origin: stackoverflow.com
WebAppContext wac = new WebAppContext();
wac.setDefaultsDescriptor( null );
代码示例来源:origin: stackoverflow.com
WebAppContext webapp = new WebAppContext(jetty_home + "/JavaServices", "/JavaServices");
webapp.setDefaultsDescriptor(jetty_home+"/etc/webdefault.xml");
webapp.setClassLoader(Thread.currentThread().getContextClassLoader());//THIS LINE IS THE KEY
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
@Override
public void initializeDefaults(Object context)
{
super.initializeDefaults(context);
if (context instanceof WebAppContext)
{
WebAppContext webapp = (WebAppContext)context;
webapp.setParentLoaderPriority(_parentLoaderPriority);
if (_defaultsDescriptor!=null)
webapp.setDefaultsDescriptor(_defaultsDescriptor);
}
}
};
代码示例来源:origin: xsank/Shour
private WebAppContext buildContext() {
WebAppContext context = new WebAppContext();
context.setDefaultsDescriptor("webapp/WEB-INF/webdefault.xml");
context.setDescriptor("webapp/WEB-INF/web.xml");
context.setResourceBase("webapp/");
context.setContextPath("/");
return context;
}
代码示例来源:origin: org.apache.nifi.registry/nifi-registry-jetty
serverClasses.remove("org.slf4j.");
webappContext.setServerClasses(serverClasses.toArray(new String[0]));
webappContext.setDefaultsDescriptor(WEB_DEFAULTS_XML);
代码示例来源:origin: apache/nifi-minifi
serverClasses.remove("org.slf4j.");
webappContext.setServerClasses(serverClasses.toArray(new String[0]));
webappContext.setDefaultsDescriptor(WEB_DEFAULTS_XML);
代码示例来源:origin: org.apache.nifi.minifi/minifi-c2-jetty
serverClasses.remove("org.slf4j.");
webappContext.setServerClasses(serverClasses.toArray(new String[0]));
webappContext.setDefaultsDescriptor(WEB_DEFAULTS_XML);
代码示例来源:origin: cd.connect.common/connect-runnable-war
context.setDefaultsDescriptor(System.getProperty(WEBAPP_WEBDEFAULT_XML_LOCATION));
} else {
context.setDefaultsDescriptor(webDefaultXml);
代码示例来源:origin: works.lmz.common/common-runnable-war
context.setDefaultsDescriptor(System.getProperty(WEBAPP_WEBDEFAULT_XML_LOCATION));
} else {
context.setDefaultsDescriptor(webDefaultXml);
代码示例来源:origin: rancher/cattle
context.setDefaultsDescriptor(defaultWebXml.toExternalForm());
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
if (_defaultsDescriptor != null)
wah.setDefaultsDescriptor(_defaultsDescriptor);
代码示例来源:origin: org.eclipse.jetty/jetty-deploy
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);
}
}
代码示例来源:origin: org.nanoframework/nano-jetty-server
private void applyHandle(final String contextPath, final String warPath) {
final ContextHandlerCollection handler = new ContextHandlerCollection();
final WebAppContext webapp = new WebAppContext();
webapp.setContextPath(contextPath);
webapp.setDefaultsDescriptor(WEB_DEFAULT);
if (StringUtils.isEmpty(warPath)) {
webapp.setResourceBase(DEFAULT_RESOURCE_BASE);
webapp.setDescriptor(DEFAULT_WEB_XML_PATH);
} else {
webapp.setWar(warPath);
}
applySessionHandler(webapp);
handler.addHandler(webapp);
super.setHandler(handler);
}
代码示例来源:origin: org.jboss.arquillian.container/arquillian-jetty-embedded-9
if (config.hasDefaultsDescriptor())
webAppContext.setDefaultsDescriptor(config.getDefaultsDescriptor().toASCIIString());
代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9
if (_defaultsDescriptor != null)
wah.setDefaultsDescriptor(_defaultsDescriptor);
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
if (_defaultsDescriptor != null)
wah.setDefaultsDescriptor(_defaultsDescriptor);
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
wah.setConfigurationClasses(_configurationClasses);
if (_defaultsDescriptor!=null)
wah.setDefaultsDescriptor(_defaultsDescriptor);
wah.setExtractWAR(_extract);
wah.setWar(app.toString());
内容来源于网络,如有侵权,请联系作者删除!