當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。