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

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

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

WebAppContext.getWebInf介绍

暂无

代码示例

代码示例来源:origin: gocd/gocd

public void init(WebAppContext webAppContext) throws IOException {
  String railsRootDirName = webAppContext.getInitParameter("rails.root").replaceAll("/WEB-INF/", "");
  String assetsDir = webAppContext.getWebInf().addPath(String.format("%s/public/assets/", railsRootDirName)).getName();
  handler.setAssetsDir(assetsDir);
}

代码示例来源:origin: gocd/gocd

@Before
public void setUp() throws Exception {
  initMocks(this);
  when(systemEnvironment.getWebappContextPath()).thenReturn("/go");
  when(webAppContext.getInitParameter("rails.root")).thenReturn("/rails.root");
  when(webAppContext.getWebInf()).thenReturn(Resource.newResource("WEB-INF"));
  handler = new AssetsContextHandler(systemEnvironment);
  handler.init(webAppContext);
}

代码示例来源:origin: org.eclipse.jetty/jetty-webapp

/**
 * Get <code>WEB-INF/classes</code> dir
 * 
 * @param context the context to look for the <code>WEB-INF/classes</code> directory
 * @return the Resource for the <code>WEB-INF/classes</code> directory
 * @throws Exception if unable to find the <code>WEB-INF/classes</code> directory
 */
protected Resource findWebInfClassesDir (WebAppContext context)
throws Exception
{
  if (context == null)
    return null;
  
  Resource web_inf = context.getWebInf();
  // Find WEB-INF/classes
  if (web_inf != null && web_inf.isDirectory())
  {
    // Look for classes directory
    Resource classes= web_inf.addPath("classes/");
    if (classes.exists())
      return classes;
  }
  return null;
}

代码示例来源:origin: org.eclipse.jetty/jetty-webapp

throws Exception
  Resource web_inf = context.getWebInf();
  if (web_inf==null || !web_inf.exists())
    return null;

代码示例来源:origin: org.eclipse.jetty/jetty-webapp

protected Resource findWebXml(WebAppContext context) throws IOException, MalformedURLException
{
  String descriptor = context.getDescriptor();
  if (descriptor != null)
  {
    Resource web = context.newResource(descriptor);
    if (web.exists() && !web.isDirectory()) return web;
  }
  Resource web_inf = context.getWebInf();
  if (web_inf != null && web_inf.isDirectory())
  {
    // do web.xml file
    Resource web = web_inf.addPath("web.xml");
    if (web.exists()) return web;
    if (LOG.isDebugEnabled())
      LOG.debug("No WEB-INF/web.xml in " + context.getWar() + ". Serving files and default/dynamic servlets only");
  }
  return null;
}

代码示例来源:origin: org.eclipse.jetty/jetty-webapp

Resource web_inf = context.getWebInf();

代码示例来源:origin: org.eclipse.jetty/jetty-webapp

Resource web_inf = context.getWebInf();

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

public File findWorkDirectory (WebAppContext context) throws IOException
{
  if (context.getBaseResource() != null)
  {
    Resource web_inf = context.getWebInf();
    if (web_inf !=null && web_inf.exists())
    {
      return new File(web_inf.getFile(),"work");
    }
  }
  return null;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

public File findWorkDirectory (WebAppContext context) throws IOException
{
  if (context.getBaseResource() != null)
  {
    Resource web_inf = context.getWebInf();
    if (web_inf !=null && web_inf.exists())
    {
      return new File(web_inf.getFile(),"work");
    }
  }
  return null;
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

public File findWorkDirectory (WebAppContext context) throws IOException
{
  if (context.getBaseResource() != null)
  {
    Resource web_inf = context.getWebInf();
    if (web_inf !=null && web_inf.exists())
    {
      return new File(web_inf.getFile(),"work");
    }
  }
  return null;
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

public File findWorkDirectory (WebAppContext context) throws IOException
{
  if (context.getBaseResource() != null)
  {
    Resource web_inf = context.getWebInf();
    if (web_inf !=null && web_inf.exists())
    {
      return new File(web_inf.getFile(),"work");
    }
  }
  return null;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

public File findWorkDirectory (WebAppContext context) throws IOException
{
  if (context.getBaseResource() != null)
  {
    Resource web_inf = context.getWebInf();
    if (web_inf !=null && web_inf.exists())
    {
      return new File(web_inf.getFile(),"work");
    }
  }
  return null;
}

代码示例来源:origin: org.eclipse.jetty/jetty-quickstart

/**
 * Get the quickstart-web.xml file as a Resource.
 * 
 * @param context the web app context
 * @return the Resource for the quickstart-web.xml
 * @throws Exception if unable to find the quickstart xml
 */
public Resource getQuickStartWebXml (WebAppContext context) throws Exception
{
  Resource webInf = context.getWebInf();
  if (webInf == null || !webInf.exists())
    throw new IllegalStateException("No WEB-INF");
  LOG.debug("webinf={}",webInf);
  Resource quickStartWebXml = webInf.addPath("quickstart-web.xml");
  if (!quickStartWebXml.exists())
    throw new IllegalStateException ("No WEB-INF/quickstart-web.xml");
  return quickStartWebXml;
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

protected Resource findWebXml(WebAppContext context) throws IOException, MalformedURLException
{
  String descriptor = context.getDescriptor();
  if (descriptor != null)
  {
    Resource web = context.newResource(descriptor);
    if (web.exists() && !web.isDirectory()) return web;
  }
  Resource web_inf = context.getWebInf();
  if (web_inf != null && web_inf.isDirectory())
  {
    // do web.xml file
    Resource web = web_inf.addPath("web.xml");
    if (web.exists()) return web;
    if (LOG.isDebugEnabled())
      LOG.debug("No WEB-INF/web.xml in " + context.getWar() + ". Serving files and default/dynamic servlets only");
  }
  return null;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

protected Resource findWebXml(WebAppContext context) throws IOException, MalformedURLException
{
  String descriptor = context.getDescriptor();
  if (descriptor != null)
  {
    Resource web = context.newResource(descriptor);
    if (web.exists() && !web.isDirectory()) return web;
  }
  Resource web_inf = context.getWebInf();
  if (web_inf != null && web_inf.isDirectory())
  {
    // do web.xml file
    Resource web = web_inf.addPath("web.xml");
    if (web.exists()) return web;
    if (LOG.isDebugEnabled())
      LOG.debug("No WEB-INF/web.xml in " + context.getWar() + ". Serving files and default/dynamic servlets only");
  }
  return null;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

protected Resource findWebXml(WebAppContext context) throws IOException, MalformedURLException
{
  String descriptor = context.getDescriptor();
  if (descriptor != null)
  {
    Resource web = context.newResource(descriptor);
    if (web.exists() && !web.isDirectory()) return web;
  }
  Resource web_inf = context.getWebInf();
  if (web_inf != null && web_inf.isDirectory())
  {
    // do web.xml file
    Resource web = web_inf.addPath("web.xml");
    if (web.exists()) return web;
    if (LOG.isDebugEnabled())
      LOG.debug("No WEB-INF/web.xml in " + context.getWar() + ". Serving files and default/dynamic servlets only");
  }
  return null;
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

protected Resource findWebXml(WebAppContext context) throws IOException, MalformedURLException
{
  String descriptor = context.getDescriptor();
  if (descriptor != null)
  {
    Resource web = context.newResource(descriptor);
    if (web.exists() && !web.isDirectory()) return web;
  }
  Resource web_inf = context.getWebInf();
  if (web_inf != null && web_inf.isDirectory())
  {
    // do web.xml file
    Resource web = web_inf.addPath("web.xml");
    if (web.exists()) return web;
    if (LOG.isDebugEnabled())
      LOG.debug("No WEB-INF/web.xml in " + context.getWar() + ". Serving files and default/dynamic servlets only");
  }
  return null;
}

代码示例来源:origin: weld/core

protected static void process(WebAppContext wac, boolean startNewHandler) throws Exception {
  EclipseWeldServletHandler wHandler = new EclipseWeldServletHandler(wac.getServletHandler(), wac.getServletContext());
  wac.setServletHandler(wHandler);
  wac.getSecurityHandler().setHandler(wHandler);
  if (startNewHandler) {
    wHandler.start();
  }
  Resource jettyEnv = null;
  Resource webInf = wac.getWebInf();
  if (webInf != null && webInf.exists()) {
    jettyEnv = webInf.addPath("jetty-env.xml");
  }
  if (jettyEnv == null || !(jettyEnv.exists())) {
    JettyLogger.LOG.missingJettyEnvXml();
  }
}

代码示例来源:origin: weld/core

protected static void process(WebAppContext wac, boolean startNewHandler) throws Exception {
  EclipseWeldServletHandler wHandler = new EclipseWeldServletHandler(wac.getServletHandler(), wac.getServletContext());
  wac.setServletHandler(wHandler);
  wac.getSecurityHandler().setHandler(wHandler);
  if (startNewHandler) {
    wHandler.start();
  }
  Resource jettyEnv = null;
  Resource webInf = wac.getWebInf();
  if (webInf != null && webInf.exists()) {
    jettyEnv = webInf.addPath("jetty-env.xml");
  }
  if (jettyEnv == null || !(jettyEnv.exists())) {
    JettyLogger.LOG.missingJettyEnvXml();
  }
}

代码示例来源:origin: org.jboss.weld.servlet/weld-servlet-shaded

protected static void process(WebAppContext wac, boolean startNewHandler) throws Exception {
  EclipseWeldServletHandler wHandler = new EclipseWeldServletHandler(wac.getServletHandler(), wac.getServletContext());
  wac.setServletHandler(wHandler);
  wac.getSecurityHandler().setHandler(wHandler);
  if (startNewHandler) {
    wHandler.start();
  }
  Resource jettyEnv = null;
  Resource webInf = wac.getWebInf();
  if (webInf != null && webInf.exists()) {
    jettyEnv = webInf.addPath("jetty-env.xml");
  }
  if (jettyEnv == null || !(jettyEnv.exists())) {
    JettyLogger.LOG.missingJettyEnvXml();
  }
}

相关文章

WebAppContext类方法