Package org.mortbay.http

Examples of org.mortbay.http.HttpContext


    SocketListener listener = new SocketListener();
    listener.setPort(0); // letting OS to pickup the PORT
    server.addListener(listener);

    // create context
    HttpContext context = new HttpContext();
    context.setContextPath(contextPath + "/*");

    // create servlet handler
    ServletHandler handler = new ServletHandler();
    handler.addServlet(servletClass.getName(), servletPath,
                       servletClass.getName());

    // bind servlet handler to context
    context.addHandler(handler);

    // bind context to servlet engine
    server.addContext(context);

    // Start server
View Full Code Here


    webServer.addListener(listener);

    // set up the context for "/logs/" if "hadoop.log.dir" property is defined.
    String logDir = System.getProperty("hadoop.log.dir");
    if (logDir != null) {
      HttpContext logContext = new HttpContext();
      logContext.setContextPath("/logs/*");
      logContext.setResourceBase(logDir);
      logContext.addHandler(new ResourceHandler());
      webServer.addContext(logContext);
    }

    // set up the context for "/static/*"
    String appDir = getWebAppsPath();
    HttpContext staticContext = new HttpContext();
    staticContext.setContextPath("/static/*");
    staticContext.setResourceBase(appDir + "/static");
    staticContext.addHandler(new ResourceHandler());
    webServer.addContext(staticContext);

    // set up the context for "/" jsp files
    webAppContext =
      webServer.addWebApplication("/", appDir + "/" + name);
View Full Code Here

    String appDir = getWebAppsPath();
   
    // Set up the context for "/logs/" if "hadoop.log.dir" property is defined.
    String logDir = System.getProperty("hadoop.log.dir");
    if (logDir != null) {
      HttpContext logContext = new HttpContext();
      logContext.setContextPath("/logs/*");
      logContext.setResourceBase(logDir);
      logContext.addHandler(new ResourceHandler());
      webServer.addContext(logContext);
    }
   
    HttpContext staticContext = new HttpContext();
    staticContext.setContextPath("/static/*");
    staticContext.setResourceBase(appDir + "/static");
    staticContext.addHandler(new ResourceHandler());
    this.webServer.addContext(staticContext);

    // set up the context for "/" jsp files
    String webappDir = null;
    try {
View Full Code Here

    String appDir = getWebAppsPath();
   
    // Set up the context for "/logs/" if "hadoop.log.dir" property is defined.
    String logDir = System.getProperty("hadoop.log.dir");
    if (logDir != null) {
      HttpContext logContext = new HttpContext();
      logContext.setContextPath("/logs/*");
      logContext.setResourceBase(logDir);
      logContext.addHandler(new ResourceHandler());
      webServer.addContext(logContext);
    }
   
    HttpContext staticContext = new HttpContext();
    staticContext.setContextPath("/static/*");
    staticContext.setResourceBase(appDir + "/static");
    staticContext.addHandler(new ResourceHandler());
    this.webServer.addContext(staticContext);

    // set up the context for "/" jsp files
    String webappDir = getWebAppDir(name);
    this.webAppContext =
View Full Code Here

    webServer.addListener(listener);

    // set up the context for "/logs/" if "hadoop.log.dir" property is defined.
    String logDir = System.getProperty("hadoop.log.dir");
    if (logDir != null) {
      HttpContext logContext = new HttpContext();
      logContext.setContextPath("/logs/*");
      logContext.setResourceBase(logDir);
      logContext.addHandler(new ResourceHandler());
      webServer.addContext(logContext);
    }

    // set up the context for "/static/*"
    String appDir = getWebAppsPath();
    HttpContext staticContext = new HttpContext();
    staticContext.setContextPath("/static/*");
    staticContext.setResourceBase(appDir + "/static");
    staticContext.addHandler(new ResourceHandler());
    webServer.addContext(staticContext);

    // set up the context for "/" jsp files
    webAppContext =
      webServer.addWebApplication("/", appDir + "/" + name);
View Full Code Here

      if (bindAddress != null)
        listener.setHost(bindAddress);
      webserver.addListener(listener);
      webserver.addWebApplication("/", webappRoot);
     
      HttpContext imagesContext = new HttpContext();
      imagesContext.setContextPath("/images/*");
      imagesContext.setResourceBase(ApplicationSetup.TERRIER_SHARE + "/images/");
      imagesContext.addHandler(new ResourceHandler());
      webserver.addContext(imagesContext);
  }
View Full Code Here


    private void assembleHandlers(boolean slowResources, RemoteControlConfiguration configuration) {
        server.addContext(createRootContextWithProxyHandler(configuration));

        HttpContext context = new HttpContext();
        context.setContextPath("/selenium-server");
        context.setMimeMapping("xhtml", "application/xhtml+xml");

        addSecurityHandler(context);
        addStaticContentHandler(slowResources, configuration, context);
        context.addHandler(new SessionExtensionJsHandler());
        context.addHandler(new SingleTestSuiteResourceHandler());
        postResultsHandler = new SeleniumHTMLRunnerResultsHandler();
        context.addHandler(postResultsHandler);
        context.addHandler(new CachedContentTestHandler());
        server.addContext(context);

        server.addContext(createDriverContextWithSeleniumDriverResourceHandler(context));
    }
View Full Code Here

        server.addContext(createDriverContextWithSeleniumDriverResourceHandler(context));
    }

    private HttpContext createDriverContextWithSeleniumDriverResourceHandler(HttpContext context) {
        // Associate the SeleniumDriverResourceHandler with the /selenium-server/driver context
        HttpContext driverContext = new HttpContext();
        driverContext.setContextPath("/selenium-server/driver");
        driver = new SeleniumDriverResourceHandler(this);
        context.addHandler(driver);
        return driverContext;
    }
View Full Code Here

        SecurityHandler sh = new SecurityHandler();
        context.addHandler(sh);
    }

    protected HttpContext createRootContextWithProxyHandler(RemoteControlConfiguration configuration) {
        HttpContext root;
       
        root = new HttpContext();
        root.setContextPath("/");
        proxyHandler = makeProxyHandler(configuration);

        // see docs for the lock object for information on this and why it is IMPORTANT!
        proxyHandler.setShutdownLock(shutdownLock);
        root.addHandler(proxyHandler);
        return root;
    }
View Full Code Here

  public void setUp() throws Exception {
    super.setUp();
    tempFile = File.createTempFile("selenium-test-", "");
    tempFile.deleteOnExit();
    resourceLocator = new FsResourceLocator(tempFile.getParentFile());
    context = new HttpContext();
  }
View Full Code Here

TOP

Related Classes of org.mortbay.http.HttpContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.