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

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

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

WebAppContext.addAliasCheck介绍

暂无

代码示例

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

webapp.setParentLoaderPriority(false);
webapp.setInitParameter("org.eclipse.jetty.servlet.Default.dirAllowed", "false");
webapp.addAliasCheck(new AllowSymLinkAliasChecker());

代码示例来源:origin: apache/incubator-edgent

/**
 * Initialization of the context path for the web application "/console" occurs in this method
 * and the handler for the web application is set.  This only occurs once.
 * @return HttpServer: the singleton instance of this class
 * @throws Exception on failure
 */
public static HttpServer getInstance() throws Exception {
  if (!HttpServerHolder.INITIALIZED) {
    logger.info("initializing");
    HttpServerHolder.WEBAPP.setContextPath("/console");
    ServletContextHandler contextJobs = new ServletContextHandler(ServletContextHandler.SESSIONS);
    contextJobs.setContextPath("/jobs");
    ServletContextHandler contextMetrics = new ServletContextHandler(ServletContextHandler.SESSIONS);
    contextMetrics.setContextPath("/metrics");
    ServerUtil sUtil = new ServerUtil();
    File servletsJarFile = sUtil.getWarFilePath();
    if (servletsJarFile.exists()){
      HttpServerHolder.WEBAPP.setWar(servletsJarFile.getAbsolutePath());
    } else {
      throw new RuntimeException("Unable to find WAR archive in " + servletsJarFile.getAbsolutePath());
    }
    HttpServerHolder.WEBAPP.addAliasCheck(new AllowSymLinkAliasChecker());
    ContextHandlerCollection contexts = new ContextHandlerCollection();
    contexts.setHandlers(new Handler[] { contextJobs, contextMetrics, HttpServerHolder.WEBAPP });
    HttpServerHolder.JETTYSERVER.setHandler(contexts);
    HttpServerHolder.INITIALIZED = true;
  }
  return HttpServerHolder.INSTANCE;
}

代码示例来源:origin: org.apache.edgent/edgent-console-server

/**
 * Initialization of the context path for the web application "/console" occurs in this method
 * and the handler for the web application is set.  This only occurs once.
 * @return HttpServer: the singleton instance of this class
 * @throws Exception on failure
 */
public static HttpServer getInstance() throws Exception {
  if (!HttpServerHolder.INITIALIZED) {
    HttpServerHolder.WEBAPP.setContextPath("/console");
    ServletContextHandler contextJobs = new ServletContextHandler(ServletContextHandler.SESSIONS);
    contextJobs.setContextPath("/jobs");
    ServletContextHandler contextMetrics = new ServletContextHandler(ServletContextHandler.SESSIONS);
    contextMetrics.setContextPath("/metrics");
    ServerUtil sUtil = new ServerUtil();
    File servletsJarFile = sUtil.getWarFilePath();
    if (servletsJarFile.exists()){
      HttpServerHolder.WEBAPP.setWar(servletsJarFile.getAbsolutePath());
    } else {
      throw new RuntimeException("Unable to find WAR archive in " + servletsJarFile.getAbsolutePath());
    }
    HttpServerHolder.WEBAPP.addAliasCheck(new AllowSymLinkAliasChecker());
    ContextHandlerCollection contexts = new ContextHandlerCollection();
    contexts.setHandlers(new Handler[] { contextJobs, contextMetrics, HttpServerHolder.WEBAPP });
    HttpServerHolder.JETTYSERVER.setHandler(contexts);
    HttpServerHolder.INITIALIZED = true;
  }
  return HttpServerHolder.INSTANCE;
}

代码示例来源:origin: eclipse/kapua

File warFile = new File(warFileName);
webapp.setWar(warFile.getAbsolutePath());
webapp.addAliasCheck(new AllowSymLinkAliasChecker());

相关文章

微信公众号

最新文章

更多

WebAppContext类方法