Package org.mortbay.jetty.webapp

Examples of org.mortbay.jetty.webapp.WebAppContext


    });
   
    HandlerCollection handlers = new HandlerCollection();
    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);
   
    /*
 
View Full Code Here


      connector.setPort(DcSettings.getInt(DcRepository.Settings.stWebServerPort));
      server.setConnectors(new Connector[]{connector});
     
      String baseDir = DataCrow.installationDir + "webapp";
     
      WebAppContext webapp = new WebAppContext();
      webapp.setContextPath(context);
      webapp.setWar(baseDir + context);
      webapp.setDefaultsDescriptor(baseDir + context + "/WEB-INF/webdefault.xml");
     
      server.setHandler(webapp);
     
      server.start();
      isRunning = true;
View Full Code Here

    connector.setMaxIdleTime(1000 * 60 * 60);
    connector.setSoLingerTime(-1);
    connector.setPort(8080);
    server.setConnectors(new Connector[] { connector });

    WebAppContext bb = new WebAppContext();
    bb.setServer(server);
    bb.setContextPath("/");
    bb.setWar("src/main/webapp");
   
    // START JMX SERVER
    // MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
    // MBeanContainer mBeanContainer = new MBeanContainer(mBeanServer);
    // server.getContainer().addEventListener(mBeanContainer);
View Full Code Here

            securityHandler.init(policyContextID, defaultPrincipal, checkedPermissions, excludedPermissions, classLoader);
        }

        ServletHandler servletHandler = new ServletHandler();

        webAppContext = new WebAppContext(securityHandler, sessionHandler, servletHandler, null);
        AbstractHandler next = sessionHandler;
        next = new ThreadClassloaderHandler(next, classLoader);

        GeronimoUserTransaction userTransaction = new GeronimoUserTransaction(transactionManager);
        Context enc = EnterpriseNamingContext.createEnterpriseNamingContext(componentContext, userTransaction, kernel, classLoader);
View Full Code Here

        securityRealm = new HashUserRealm( "Test Server" );

        securityHandler.setUserRealm( securityRealm );
        securityHandler.setConstraintMappings( new ConstraintMapping[]{ cm } );

        webappContext = new WebAppContext();
        webappContext.setContextPath( "/" );

        File base = getResource( SERVER_ROOT_RESOURCE_PATH );
        logger.info( "docroot: " + base );
        webappContext.setWar( base.getAbsolutePath() );
View Full Code Here

    private static WebAppContext buildContext() throws IOException {
        ProtectionDomain protectionDomain = Startup.class.getProtectionDomain();
        URL location = protectionDomain.getCodeSource().getLocation();

        WebAppContext context = new WebAppContext();
        WebAppClassLoader webAppClassLoader = new WebAppClassLoader(Startup.class.getClassLoader(),context);
        context.setClassLoader(webAppClassLoader);
        context.setContextPath(URIUtil.SLASH);
        context.setWar(location.toExternalForm());

        if( tempDir != null ) {
            File tempDirectory = new File(tempDir);
            context.setTempDirectory(tempDirectory);
        }
        return context;
    }
View Full Code Here

    }

    public static void main(String[] args) throws Exception {
        setThreadClassLoader();
        processOptions();
        WebAppContext context = buildContext();

        Server server = new Server();
        if( usingSSL ) {
            server.setConnectors(new Connector[]{buildConnector(),buildSslConnector()});
        }
View Full Code Here

    connector.setMaxIdleTime(1000 * 60 * 60);
    connector.setSoLingerTime(-1);
    connector.setPort(8080);
    server.setConnectors(new Connector[] { connector });

    WebAppContext bb = new WebAppContext();
    bb.setServer(server);
    bb.setContextPath("/");
    bb.setWar("src/main/webapp");

    // START JMX SERVER
    // MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
    // MBeanContainer mBeanContainer = new MBeanContainer(mBeanServer);
    // server.getContainer().addEventListener(mBeanContainer);
View Full Code Here

    connector.setMaxIdleTime(1000 * 60 * 60);
    connector.setSoLingerTime(-1);
    connector.setPort(8080);
    server.setConnectors(new Connector[] { connector });

    WebAppContext bb = new WebAppContext();
    bb.setServer(server);
    bb.setContextPath("/lottery");
    bb.setWar("src/main/webapp");
   
    // START JMX SERVER
    // MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
    // MBeanContainer mBeanContainer = new MBeanContainer(mBeanServer);
    // server.getContainer().addEventListener(mBeanContainer);
View Full Code Here

        jetty = new Server();
        Connector connector = new SelectChannelConnector();
        connector.setPort(port);
        jetty.setConnectors(new Connector[] { connector });

        WebAppContext wactx = new WebAppContext();
        wactx.setClassLoader(AbstractWebTest.class.getClassLoader());
        wactx.setParentLoaderPriority(true);
        wactx.setContextPath(ctx);
        wactx.setWar("src/test/resources/standard");

        HandlerCollection handlers = new HandlerCollection();
        handlers.setHandlers(new Handler[] { wactx, new DefaultHandler() });
        jetty.setHandler(handlers);
View Full Code Here

TOP

Related Classes of org.mortbay.jetty.webapp.WebAppContext

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.