org.mortbay.jetty.webapp.WebAppContext.setWar()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(213)

本文整理了Java中org.mortbay.jetty.webapp.WebAppContext.setWar()方法的一些代码示例,展示了WebAppContext.setWar()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebAppContext.setWar()方法的具体详情如下:
包路径:org.mortbay.jetty.webapp.WebAppContext
类名称:WebAppContext
方法名:setWar

WebAppContext.setWar介绍

暂无

代码示例

代码示例来源:origin: ltsopensource/light-task-scheduler

webapp.setWar(confPath + "/war/lts-admin.war");
webapp.setContextPath(contextPath);
Map<String, String> initParams = new HashMap<String, String>();

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

/**
 * @param parent The parent HandlerContainer.
 * @param contextPath The context path
 * @param webApp The URL or filename of the webapp directory or war file.
 */
public WebAppContext(HandlerContainer parent, String webApp, String contextPath)
{
  super(parent,contextPath,SESSIONS|SECURITY);
  setWar(webApp);
  setErrorHandler(new ErrorPageErrorHandler());
}

代码示例来源:origin: com.mysema.commons/mysema-commons-jetty

public static JettyConfig startJetty(JettyConfig config) {
  WebAppContext webappcontext = new WebAppContext();
  webappcontext.setContextPath(config.contextPath);
  webappcontext.setWar(config.warPath);
  if (new File(config.warPath).isFile()) {
    webappcontext.setExtractWAR(true);
  }
  return startJetty(config, webappcontext);
}

代码示例来源:origin: feroult/yawp

protected WebAppContext createWebAppContext() {
  try {
    Resource jettyEnv = Resource.newResource(String.format("%s/WEB-INF/jetty-env.xml", mojo.getAppDir()));
    XmlConfiguration conf = new XmlConfiguration(jettyEnv.getInputStream());
    WebAppContext webapp = (WebAppContext) conf.configure();
    webapp.setWar(mojo.getAppDir());
    System.setProperty("java.naming.factory.url.pkgs", "org.mortbay.naming");
    System.setProperty("java.naming.factory.initial", "org.mortbay.naming.InitialContextFactory");
    return webapp;
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

/**
 * @param contextPath The context path
 * @param webApp The URL or filename of the webapp directory or war file.
 */
public WebAppContext(String webApp,String contextPath)
{
  super(null,contextPath,SESSIONS|SECURITY);
  setContextPath(contextPath);
  setWar(webApp);
  setErrorHandler(new ErrorPageErrorHandler());
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

/**
 * Add a context 
 * @param pathSpec The path spec for the context
 * @param dir The directory containing the context
 * @param isFiltered if true, the servlet is added to the filter path mapping 
 * @throws IOException
 */
protected void addContext(String pathSpec, String dir, boolean isFiltered) throws IOException {
 if (0 == webServer.getHandlers().length) {
  throw new RuntimeException("Couldn't find handler");
 }
 WebAppContext webAppCtx = new WebAppContext();
 webAppCtx.setContextPath(pathSpec);
 webAppCtx.setWar(dir);
 addContext(webAppCtx, true);
}

代码示例来源:origin: io.fabric8/fabric-hadoop

/**
 * Add a context 
 * @param pathSpec The path spec for the context
 * @param dir The directory containing the context
 * @param isFiltered if true, the servlet is added to the filter path mapping 
 * @throws IOException
 */
protected void addContext(String pathSpec, String dir, boolean isFiltered) throws IOException {
 if (0 == webServer.getHandlers().length) {
  throw new RuntimeException("Couldn't find handler");
 }
 WebAppContext webAppCtx = new WebAppContext();
 webAppCtx.setContextPath(pathSpec);
 webAppCtx.setWar(dir);
 addContext(webAppCtx, true);
}

代码示例来源:origin: apache/tajo

/**
 * Add a context 
 * @param pathSpec The path spec for the context
 * @param dir The directory containing the context
 * @param isFiltered if true, the servlet is added to the filter path mapping 
 * @throws IOException
 */
protected void addContext(String pathSpec, String dir, boolean isFiltered) throws IOException {
 if (0 == webServer.getHandlers().length) {
  throw new RuntimeException("Couldn't find handler");
 }
 WebAppContext webAppCtx = new WebAppContext();
 webAppCtx.setContextPath(pathSpec);
 webAppCtx.setWar(dir);
 addContext(webAppCtx, true);
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-standalone

private void prepareWebapp(File file, File repository, File tmp) {
  webapp.setContextPath("/");
  webapp.setWar(file.getPath());
  webapp.setExtractWAR(false);
  webapp.setTempDirectory(tmp);
  ServletHolder servlet =
    new ServletHolder(JackrabbitRepositoryServlet.class);
  servlet.setInitOrder(1);
  servlet.setInitParameter("repository.home", repository.getPath());
  String conf = command.getOptionValue("conf");
  if (conf != null) {
    servlet.setInitParameter("repository.config", conf);
  }
  webapp.addServlet(servlet, "/repository.properties");
}

代码示例来源:origin: org.apache.hive.shims/hive-shims-0.20

public void addWar(String war, String contextPath) {
 WebAppContext wac = new WebAppContext();
 wac.setContextPath(contextPath);
 wac.setWar(war);
 RequestLogHandler rlh = new RequestLogHandler();
 rlh.setHandler(wac);
 this.addHandler(rlh);
}

代码示例来源:origin: com.github.hyukjinkwon.shims/hive-shims-0.20S

public void addWar(String war, String contextPath) {
 WebAppContext wac = new WebAppContext();
 wac.setContextPath(contextPath);
 wac.setWar(war);
 RequestLogHandler rlh = new RequestLogHandler();
 rlh.setHandler(wac);
 this.addHandler(rlh);
}

代码示例来源:origin: com.github.hyukjinkwon.shims/hive-shims-0.23

public void addWar(String war, String contextPath) {
 WebAppContext wac = new WebAppContext();
 wac.setContextPath(contextPath);
 wac.setWar(war);
 RequestLogHandler rlh = new RequestLogHandler();
 rlh.setHandler(wac);
 this.addHandler(rlh);
}

代码示例来源:origin: org.spark-project.hive.shims/hive-shims-0.23

public void addWar(String war, String contextPath) {
 WebAppContext wac = new WebAppContext();
 wac.setContextPath(contextPath);
 wac.setWar(war);
 RequestLogHandler rlh = new RequestLogHandler();
 rlh.setHandler(wac);
 this.addHandler(rlh);
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

public void addWar(String war, String contextPath) {
 WebAppContext wac = new WebAppContext();
 wac.setContextPath(contextPath);
 wac.setWar(war);
 RequestLogHandler rlh = new RequestLogHandler();
 rlh.setHandler(wac);
 this.addHandler(rlh);
}

代码示例来源:origin: org.spark-project.hive.shims/hive-shims-0.20

public void addWar(String war, String contextPath) {
 WebAppContext wac = new WebAppContext();
 wac.setContextPath(contextPath);
 wac.setWar(war);
 RequestLogHandler rlh = new RequestLogHandler();
 rlh.setHandler(wac);
 this.addHandler(rlh);
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

public void addWar(String war, String contextPath) {
 WebAppContext wac = new WebAppContext();
 wac.setContextPath(contextPath);
 wac.setWar(war);
 RequestLogHandler rlh = new RequestLogHandler();
 rlh.setHandler(wac);
 this.addHandler(rlh);
}

代码示例来源:origin: edu.berkeley.cs.shark/hive-shims

public void addWar(String war, String contextPath) {
 WebAppContext wac = new WebAppContext();
 wac.setContextPath(contextPath);
 wac.setWar(war);
 RequestLogHandler rlh = new RequestLogHandler();
 rlh.setHandler(wac);
 this.addHandler(rlh);
}

代码示例来源:origin: net.disy.legato/legato-testing

@Override
public void addWebAppContext(final String contextPath, final String location) {
 final WebAppContext webAppContext = new WebAppContext();
 webAppContext.setContextPath(contextPath);
 webAppContext.setConfigurationClasses(DEFAULT_CONFIGURATION_CLASSES);
 webAppContext.setWar(location);
 webAppContext
   .setDefaultsDescriptor("net/disy/legato/testing/server/jetty/webapp/webdefault.xml");
 // final ServletHolder servlet = webAppContext.getServletHandler()
 // .getServlet("default");
 // String aaa = servlet.getInitParameter("useFileMappedBuffer");
 // servlet.setInitParameter("useFileMappedBuffer", "true");
 server.addHandler(webAppContext);
}

代码示例来源:origin: info.aduna.commons/aduna-commons-net-http-server-embedded

public EmbeddedServer(String host, int port, String contextPath, String warPath) {
  System.clearProperty("DEBUG");
  jetty = new Server();
  Connector conn = new BlockingChannelConnector();
  conn.setHost(host);
  conn.setPort(port);
  jetty.addConnector(conn);
  WebAppContext webapp = new WebAppContext();
  webapp.setContextPath(contextPath);
  webapp.setWar(warPath);
  jetty.addHandler(webapp);
}

代码示例来源:origin: io.hops/hadoop-common

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;
}

相关文章

WebAppContext类方法