当前位置: 首页>>代码示例>>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;未经允许,请勿转载。