Package org.eclipse.jetty.server.handler

Examples of org.eclipse.jetty.server.handler.ContextHandlerCollection.addHandler()


        // This will cause jetty to ignore all of the framework and jdbc jars in the war, which is what we want.
        lcfAuthorityService.setParentLoaderPriority(true);
        contexts.addHandler(lcfAuthorityService);
        WebAppContext lcfApi = new WebAppContext(apiWarPath,"/mcf-api-service");
        lcfApi.setParentLoaderPriority(true);
        contexts.addHandler(lcfApi);
        server.start();
      }

      // If all worked, then we can start the daemon.
      // Clear the agents shutdown signal.
View Full Code Here


      + "application/xhtml+xml,application/xml,application/javascript,application/json");
    gzipFilter.setInitParameter("minGzipSize", "860");
    webAppContext.addFilter(gzipFilter, "/*", all);


    contexts.addHandler(webAppContext);
      } catch (Exception e) {
    String msg = "Error Configuring Webapp:\n" + e.getClass().getSimpleName() + "\n" + Arrays.toString(e.getStackTrace()).replaceAll(",", "\n");
    System.out.println(msg);
    log.warn(msg);
      }
View Full Code Here

    }

    server = new Server(httpPort);
    ContextHandlerCollection contexts = new ContextHandlerCollection();

    contexts.addHandler(new DefaultHandler());

    final ServletContextHandler servletContext = new ServletContextHandler(server, contextPath, true, true);
    final List<Connector> connectors = new LinkedList<>();

    // create resource collection from base path & source JAR
View Full Code Here

      gzipFilter.setInitParameter("methods", "GET,POST");
      servletContext.addFilter(gzipFilter, "/*", EnumSet.of(DispatcherType.REQUEST, async ? DispatcherType.ASYNC : DispatcherType.FORWARD));

    }

    contexts.addHandler(servletContext);

    // enable request logging
    if (logRequests || "true".equals(finalConfig.getProperty("log.requests", "false"))) {

      String etcPath = basePath + "/etc";
View Full Code Here

    }

    final List<ContextHandler> resourceHandler = collectResourceHandlers(finalConfig);
    for (ContextHandler contextHandler : resourceHandler) {
      contexts.addHandler(contextHandler);
    }

    final Map<String, ServletHolder> servlets = collectServlets(finalConfig);

    // add servlet elements
View Full Code Here

      logger.log(Level.INFO, "Adding servlet {0} for {1}", new Object[]{servletHolder, path});

      servletContext.addServlet(servletHolder, path);
    }

    contexts.addHandler(servletContext);

    if (host != null && !host.isEmpty() && httpPort > -1) {

      httpConfig = new HttpConfiguration();
      httpConfig.setSecureScheme("https");
View Full Code Here

        HandlerCollection handlers = new HandlerCollection();

        // handler1
        ContextHandlerCollection contexts = new ContextHandlerCollection();

        contexts.addHandler(createWebAppContext());

        // handler2
        DefaultHandler defaultHandler = new DefaultHandler();

        // handler3
View Full Code Here

    ClassPathResourceHandler resourceHandler = new ClassPathResourceHandler();
    resourceHandler.setContextPath("/");

    ContextHandlerCollection contexts = new ContextHandlerCollection();
    contexts.addHandler(resourceHandler);

    contexts.addHandler(webapp);

    server.setHandler(contexts);
View Full Code Here

    resourceHandler.setContextPath("/");

    ContextHandlerCollection contexts = new ContextHandlerCollection();
    contexts.addHandler(resourceHandler);

    contexts.addHandler(webapp);

    server.setHandler(contexts);

    server.start();
    // Construct the arguments for Mockey
View Full Code Here

        params.put("resourceCache", "resourceCache");
        defaultServlet.setInitParameters(params);
        defaultServlet.setInitOrder(0);
        webAppContext.addServlet(defaultServlet, "/");
       
        contexts.addHandler(webAppContext);
      } catch (Exception e) {
        String msg = "Error Configuring Webapp:\n" + e.getClass().getSimpleName() + "\n" + Arrays.toString(e.getStackTrace()).replaceAll(",", "\n");
        System.out.println(msg);
        log.warn(msg);
      }     
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.