当前位置: 首页>>代码示例>>Java>>正文


Java MovedContextHandler类代码示例

本文整理汇总了Java中org.eclipse.jetty.server.handler.MovedContextHandler的典型用法代码示例。如果您正苦于以下问题:Java MovedContextHandler类的具体用法?Java MovedContextHandler怎么用?Java MovedContextHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MovedContextHandler类属于org.eclipse.jetty.server.handler包,在下文中一共展示了MovedContextHandler类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: before_suite

import org.eclipse.jetty.server.handler.MovedContextHandler; //导入依赖的package包/类
@BeforeSuite
public void before_suite() throws Exception {

    // Launch Protractor's own test app on http://localhost:8080
    ((StdErrLog) Log.getRootLogger()).setLevel(StdErrLog.LEVEL_OFF);
    webServer = new Server(new QueuedThreadPool(6));
    ServerConnector connector = new ServerConnector(webServer, new HttpConnectionFactory());
    connector.setPort(8080);
    webServer.addConnector(connector);
    ResourceHandler resource_handler = new ResourceHandler();
    resource_handler.setDirectoriesListed(true);
    resource_handler.setWelcomeFiles(new String[]{"index.html"});
    resource_handler.setResourceBase("src/test/webapp");
    HandlerList handlers = new HandlerList();
    MovedContextHandler effective_symlink = new MovedContextHandler(webServer, "/lib/angular", "/lib/angular_v1.2.9");
    handlers.setHandlers(new Handler[] { effective_symlink, resource_handler, new DefaultHandler() });
    webServer.setHandler(handlers);
    webServer.start();

    driver = new ChromeDriver();
    driver.manage().timeouts().setScriptTimeout(30, TimeUnit.SECONDS);
    ngWebDriver = new NgWebDriver(driver);
}
 
开发者ID:paul-hammant,项目名称:ngWebDriver,代码行数:24,代码来源:AngularAndWebDriverTest.java

示例2: createHandlers

import org.eclipse.jetty.server.handler.MovedContextHandler; //导入依赖的package包/类
private HandlerCollection createHandlers() {
    final WebAppContext webApp = new WebAppContext();
    webApp.setContextPath(contextPath);
    webApp.setInitParameter("org.eclipse.jetty.servlet.Default.dirAllowed", "false");
    webApp.getSessionHandler().setMaxInactiveInterval(sessionTimeout * 60);

    // GZIP handler
    final GzipHandler gzipHandler = new GzipHandler();
    gzipHandler.addIncludedMimeTypes("text/html", "text/xml", "text/css", "text/plain", "text/javascript", "application/javascript", "application/json", "application/xml");
    gzipHandler.setIncludedMethods("GET", "POST");
    gzipHandler.setCompressionLevel(9);
    gzipHandler.setHandler(webApp);

    if (Strings.isNullOrEmpty(webAppLocation)) {
        webApp.setWar(getShadedWarUrl());
    } else {
        webApp.setWar(webAppLocation);
    }

    // Request log handler
    final RequestLogHandler log = new RequestLogHandler();
    log.setRequestLog(createRequestLog());

    // Redirect root context handler
    MovedContextHandler rootRedirect = new MovedContextHandler();
    rootRedirect.setContextPath("/");
    rootRedirect.setNewContextURL(contextPath);
    rootRedirect.setPermanent(true);

    // Put rootRedirect at the end!
    return new HandlerCollection(log, gzipHandler, rootRedirect);
}
 
开发者ID:apache,项目名称:cloudstack,代码行数:33,代码来源:ServerDaemon.java

示例3: startHttpd

import org.eclipse.jetty.server.handler.MovedContextHandler; //导入依赖的package包/类
@BeforeClass
public static void startHttpd() throws Exception {
  httpd = new HttpdForTests();
  httpd.addHandler(new MovedContextHandler(null, "/redirect", "/out"));
  httpd.addStaticContent("cheese");

  httpd.start();
}
 
开发者ID:facebook,项目名称:buck,代码行数:9,代码来源:HttpDownloaderIntegrationTest.java


注:本文中的org.eclipse.jetty.server.handler.MovedContextHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。