當前位置: 首頁>>代碼示例>>Java>>正文


Java WebAppContext.setDisplayName方法代碼示例

本文整理匯總了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;
}
 
開發者ID:nucypher,項目名稱:hadoop-oss,代碼行數:23,代碼來源:HttpServer2.java

示例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;
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:12,代碼來源:HttpServer.java

示例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();
}
 
開發者ID:iMartinezMateu,項目名稱:openbravo-pos,代碼行數:14,代碼來源:WebApplicationProxyImpl.java

示例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);
}
 
開發者ID:apache,項目名稱:tajo,代碼行數:43,代碼來源:HttpServer.java

示例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();
}
 
開發者ID:Seagate,項目名稱:hadoop-on-lustre,代碼行數:45,代碼來源:HttpServer.java


注:本文中的org.mortbay.jetty.webapp.WebAppContext.setDisplayName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。