Package org.mortbay.jetty.handler

Examples of org.mortbay.jetty.handler.ContextHandlerCollection.addHandler()


    ContextHandlerCollection contexts = new ContextHandlerCollection();

    WebAppContext webAppContext1 = new WebAppContext("samples/actiontest/dist/actiontest", "/actiontest");
    WebAppContext webAppContext2 = new WebAppContext("samples/holiday-booking/dist/holidaybooking",
        "/holidaybooking");
    contexts.addHandler(webAppContext1);
    contexts.addHandler(webAppContext2);
   
    /*
    This code is required for hot deployment, although
    it needs to point to a valid jetty.xml file to work
View Full Code Here


    WebAppContext webAppContext1 = new WebAppContext("samples/actiontest/dist/actiontest", "/actiontest");
    WebAppContext webAppContext2 = new WebAppContext("samples/holiday-booking/dist/holidaybooking",
        "/holidaybooking");
    contexts.addHandler(webAppContext1);
    contexts.addHandler(webAppContext2);
   
    /*
    This code is required for hot deployment, although
    it needs to point to a valid jetty.xml file to work
    correctly (ie it won't currently work)
View Full Code Here

        } else {
            context.setHandler(handler);
        }
        context.setAttribute("processor", processor);
        // add context
        contexts.addHandler(context);
        handler.initialize();
        context.start();
        return context;
    }
View Full Code Here

        context.setHandler(handler);

        ContextHandlerCollection contexts = new ContextHandlerCollection();
        HandlerCollection handlers = new HandlerCollection();
        handlers.setHandlers(new Handler[] {contexts});
        contexts.addHandler(context);

        SelectChannelConnector connector = new SelectChannelConnector();
        connector.setHost("localhost");
        connector.setPort(8190);
View Full Code Here

        Context other = new Context(contexts,"/other",Context.SESSIONS);
        other.addServlet("org.mortbay.jetty.example.ManyServletContexts$HelloServlet", "/*");

        StatisticsHandler stats = new StatisticsHandler();
        contexts.addHandler(stats);
        Context yetanother =new Context(stats,"/yo",Context.SESSIONS);
        yetanother.addServlet(new ServletHolder(new HelloServlet("YO!")), "/*");

        server.start();
        server.join();
View Full Code Here

                context.setContextPath(URIUtil.SLASH);
                context.setResourceBase(args.length==1?".":args[1]);
                ServletHandler servlet = new ServletHandler();
                servlet.addServletWithMapping("org.mortbay.jetty.servlet.DefaultServlet", URIUtil.SLASH);
                context.setHandler(servlet);
                contexts.addHandler(context);
            }
            else if ("-webapps".equals(args[1]))
            {
                WebAppContext.addWebApplications(server, args[2], WebAppContext.WEB_DEFAULTS_XML, true, true);
            }
View Full Code Here

            else if ("-webapp".equals(args[1]))
            {
                WebAppContext webapp = new WebAppContext();
                webapp.setWar(args[2]);
                webapp.setContextPath(URIUtil.SLASH);
                contexts.addHandler(webapp);
            }
               
            server.start();
           
        }
View Full Code Here

    webAppContext.setDisplayName(name);
    webAppContext.setContextPath("/");
    webAppContext.setResourceBase(appDir + "/" + name);
    webAppContext.setDescriptor(appDir + "/" + name + "/WEB-INF/web.xml");

    contexts.addHandler(webAppContext);
    webServer.setHandler(contexts);

    addDefaultApps(contexts, appDir, conf);
  }
View Full Code Here

                context.setContextPath(URIUtil.SLASH);
                context.setResourceBase(args.length==1?".":args[1]);
                ServletHandler servlet = new ServletHandler();
                servlet.addServletWithMapping("org.mortbay.jetty.servlet.DefaultServlet", URIUtil.SLASH);
                context.setHandler(servlet);
                contexts.addHandler(context);
            }
            else if ("-webapps".equals(args[1]))
            {
                WebAppContext.addWebApplications(server, args[2], WebAppContext.WEB_DEFAULTS_XML, true, true);
            }
View Full Code Here

            else if ("-webapp".equals(args[1]))
            {
                WebAppContext webapp = new WebAppContext();
                webapp.setResourceBase(args[2]);
                webapp.setContextPath(URIUtil.SLASH);
                contexts.addHandler(webapp);
               
            }
               
            server.start();
           
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.