本文整理匯總了Java中org.mortbay.jetty.webapp.WebAppContext.setDisplayName方法的典型用法代碼示例。如果您正苦於以下問題:Java WebAppContext.setDisplayName方法的具體用法?Java WebAppContext.setDisplayName怎麽用?Java WebAppContext.setDisplayName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.mortbay.jetty.webapp.WebAppContext
的用法示例。
在下文中一共展示了WebAppContext.setDisplayName方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createWebAppContext
import org.mortbay.jetty.webapp.WebAppContext; //導入方法依賴的package包/類
private static WebAppContext createWebAppContext(String name,
Configuration conf, 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(name);
ctx.setContextPath("/");
ctx.setWar(appDir + "/" + name);
ctx.getServletContext().setAttribute(CONF_CONTEXT_ATTRIBUTE, conf);
ctx.getServletContext().setAttribute(ADMINS_ACL, adminsAcl);
addNoCacheFilter(ctx);
return ctx;
}
示例2: createWebAppContext
import org.mortbay.jetty.webapp.WebAppContext; //導入方法依賴的package包/類
private static WebAppContext createWebAppContext(String name,
Configuration conf, AccessControlList adminsAcl, final String appDir) {
WebAppContext ctx = new WebAppContext();
ctx.setDisplayName(name);
ctx.setContextPath("/");
ctx.setWar(appDir + "/" + name);
ctx.getServletContext().setAttribute(CONF_CONTEXT_ATTRIBUTE, conf);
ctx.getServletContext().setAttribute(ADMINS_ACL, adminsAcl);
addNoCacheFilter(ctx);
return ctx;
}
示例3: createApplicationContext
import org.mortbay.jetty.webapp.WebAppContext; //導入方法依賴的package包/類
/**
* @see com.sabre.ant.jetty.WebApplicationProxy#createApplicationContext(org.mortbay.jetty.handler.ContextHandlerCollection)
*/
public void createApplicationContext(ContextHandlerCollection contexts)
{
webAppContext = new WebAppContext(contexts, warFile.getAbsolutePath(), contextPath);
webAppContext.setDisplayName(name);
configurePaths();
configureHandlers(contexts);
applyConfiguration();
}
示例4: HttpServer
import org.mortbay.jetty.webapp.WebAppContext; //導入方法依賴的package包/類
public HttpServer(String name, String bindAddress, int port,
boolean findPort, Connector connector, Configuration conf,
String[] pathSpecs) throws IOException {
this.webServer = new Server();
this.findPort = findPort;
if (connector == null) {
listenerStartedExternally = false;
listener = createBaseListener(conf);
listener.setHost(bindAddress);
listener.setPort(port);
} else {
listenerStartedExternally = true;
listener = connector;
}
webServer.addConnector(listener);
SessionIdManager sessionIdManager = new HashSessionIdManager(new Random(System.currentTimeMillis()));
webServer.setSessionIdManager(sessionIdManager);
int maxThreads = conf.getInt("tajo.http.maxthreads", -1);
// If HTTP_MAX_THREADS is not configured, QueueThreadPool() will use the
// default value (currently 250).
QueuedThreadPool threadPool = maxThreads == -1 ? new QueuedThreadPool()
: new QueuedThreadPool(maxThreads);
webServer.setThreadPool(threadPool);
final String appDir = getWebAppsPath(name);
ContextHandlerCollection contexts = new ContextHandlerCollection();
webAppContext = new WebAppContext();
webAppContext.setDisplayName(name);
webAppContext.setContextPath("/");
webAppContext.setResourceBase(appDir + "/" + name);
webAppContext.setDescriptor(appDir + "/" + name + "/WEB-INF/web.xml");
contexts.addHandler(webAppContext);
webServer.setHandler(contexts);
addDefaultApps(contexts, appDir, conf);
}
示例5: HttpServer
import org.mortbay.jetty.webapp.WebAppContext; //導入方法依賴的package包/類
public HttpServer(String name, String bindAddress, int port,
boolean findPort, Configuration conf, AccessControlList adminsAcl,
Connector connector) throws IOException{
webServer = new Server();
this.findPort = findPort;
this.conf = conf;
this.adminsAcl = adminsAcl;
if(connector == null) {
listenerStartedExternally = false;
listener = createBaseListener(conf);
listener.setHost(bindAddress);
listener.setPort(port);
} else {
listenerStartedExternally = true;
listener = connector;
}
webServer.addConnector(listener);
webServer.setThreadPool(new QueuedThreadPool());
final String appDir = getWebAppsPath();
ContextHandlerCollection contexts = new ContextHandlerCollection();
webServer.setHandler(contexts);
webAppContext = new WebAppContext();
webAppContext.setDisplayName("WepAppsContext");
webAppContext.setContextPath("/");
webAppContext.setWar(appDir + "/" + name);
webAppContext.getServletContext().setAttribute(CONF_CONTEXT_ATTRIBUTE, conf);
webAppContext.getServletContext().setAttribute(ADMINS_ACL, adminsAcl);
webServer.addHandler(webAppContext);
addDefaultApps(contexts, appDir);
addGlobalFilter("safety", QuotingInputFilter.class.getName(), null);
final FilterInitializer[] initializers = getFilterInitializers(conf);
if (initializers != null) {
for(FilterInitializer c : initializers) {
c.initFilter(this, conf);
}
}
addDefaultServlets();
}