Package org.eclipse.jetty.servlet

Examples of org.eclipse.jetty.servlet.ServletHolder$Config


   
    ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
    context.setContextPath(contextPath);
    jettyServer.setHandler(context);
  
    context.addServlet(new ServletHolder(servlet), servletPath + "/*");
         
    jettyServer.start();
   
    port = jettyServer.getConnectors()[0].getLocalPort();
  }
View Full Code Here


    public void startServer() throws Exception {
        server = new Server(port);
        ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
        context.setContextPath("/");
        server.setHandler(context);
        context.addServlet(new ServletHolder(atmoServlet), "/*");
        server.start();
    }
View Full Code Here

        context.setContextPath("/");
        server.setHandler(context);

        atmoServlet = new AtmosphereServlet();
        configureCometSupport();
        context.addServlet(new ServletHolder(atmoServlet), "/");
        server.start();
    }
View Full Code Here

        });
        PrivateAccessor.setField(servlet, "httpService", httpService);
        ComponentContext cc = null;
        PrivateAccessor.invoke(servlet, "activate", new Class[] {ComponentContext.class}, new Object[] {cc});

        ServletHolder holder =
                new ServletHolder(servlet);

        servletContext.addServlet(holder, "/system/console/topology/*");

        jettyServer = new Server();
        jettyServer.setHandler(servletContext);
View Full Code Here

        addRestServlet(root, "keystore", KeyStore.class);
        addRestServlet(root, "truststore", TrustStore.class);
        addRestServlet(root, "plugin", Plugin.class);
        addRestServlet(root, "preferencesprovider", AuthenticationProvider.class, PreferencesProvider.class);

        root.addServlet(new ServletHolder(new UserPreferencesServlet()), "/rest/userpreferences/*");
        root.addServlet(new ServletHolder(new LoggedOnUserPreferencesServlet()), "/rest/preferences");
        root.addServlet(new ServletHolder(new StructureServlet()), "/rest/structure");
        root.addServlet(new ServletHolder(new MessageServlet()), "/rest/message/*");
        root.addServlet(new ServletHolder(new MessageContentServlet()), "/rest/message-content/*");

        root.addServlet(new ServletHolder(new LogRecordsServlet()), "/rest/logrecords");

        root.addServlet(new ServletHolder(new SaslServlet()), "/rest/sasl");

        root.addServlet(new ServletHolder(new DefinedFileServlet("index.html")), HttpManagementUtil.ENTRY_POINT_PATH);
        root.addServlet(new ServletHolder(new DefinedFileServlet("index.html")), "/");
        root.addServlet(new ServletHolder(new LogoutServlet()), "/logout");

        root.addServlet(new ServletHolder(new FileServlet(DojoHelper.getDojoPath(), true)), "/dojo/dojo/*");
        root.addServlet(new ServletHolder(new FileServlet(DojoHelper.getDijitPath(), true)), "/dojo/dijit/*");
        root.addServlet(new ServletHolder(new FileServlet(DojoHelper.getDojoxPath(), true)), "/dojo/dojox/*");

        root.addServlet(new ServletHolder(new FileServlet()), "*.js");
        root.addServlet(new ServletHolder(new FileServlet()), "*.css");
        root.addServlet(new ServletHolder(new FileServlet()), "*.html");
        root.addServlet(new ServletHolder(new FileServlet()), "*.png");
        root.addServlet(new ServletHolder(new FileServlet()), "*.gif");
        root.addServlet(new ServletHolder(new FileServlet()), "*.jpg");
        root.addServlet(new ServletHolder(new FileServlet()), "*.jpeg");
        root.addServlet(new ServletHolder(new FileServlet()), "*.json");
        root.addServlet(new ServletHolder(new FileServlet()), "*.txt");
        root.addServlet(new ServletHolder(new FileServlet()), "*.xsl");
        root.addServlet(new ServletHolder(new HelperServlet()), "/rest/helper");
        root.addServlet(new ServletHolder(new LogFileListingServlet()), "/rest/logfilenames");
        root.addServlet(new ServletHolder(new LogFileServlet()), "/rest/logfile");

        final SessionManager sessionManager = root.getSessionHandler().getSessionManager();
        sessionManager.setSessionCookie(JSESSIONID_COOKIE_PREFIX + lastPort);
        sessionManager.setMaxInactiveInterval((Integer)getAttribute(TIME_OUT));

View Full Code Here

        return server;
    }

    private void addRestServlet(ServletContextHandler root, String name, Class<? extends ConfiguredObject>... hierarchy)
    {
        root.addServlet(new ServletHolder(new RestServlet(hierarchy)), "/rest/" + name + "/*");
    }
View Full Code Here

    context = new WebAppContext("src/test/webapp", "/");
    context.setParentLoaderPriority(true);
   
    // Add support for JSP
    ServletHolder jsp = context.addServlet(JspServlet.class, "*.jsp");
    jsp.setInitParameter("classpath", context.getClassPath());

    // Add new servlet context attributes
    context.setAttribute("persons", Mock.persons);
    context.setAttribute("emptyList", new ArrayList<Person>());
    context.setAttribute("nullList", null);
View Full Code Here

    public void testSslFilterWithRelativeRedirectURL() throws Exception
    {
        String servletPath = "/test";
        String redirectPath = "/foo";

        this.context.addServlet(new ServletHolder(new RedirectServlet(redirectPath)), servletPath);
        this.server.start();

        HttpURLConnection conn = openConnection(createURL(servletPath));

        assertEquals(302, conn.getResponseCode());
View Full Code Here

    public void testSslFilterWithAbsoluteRedirectURL() throws Exception
    {
        String servletPath = "/test";
        String redirectPath = String.format("http://%s:%d/foo", this.serverAddress.getHostName(), this.serverAddress.getPort());

        this.context.addServlet(new ServletHolder(new RedirectServlet(redirectPath)), servletPath);
        this.server.start();

        HttpURLConnection conn = openConnection(createURL(servletPath));

        assertEquals(302, conn.getResponseCode());
View Full Code Here

    public void testSslFilterWithAbsoluteRedirectURLWithoutScheme() throws Exception
    {
        String servletPath = "/test";
        String redirectPath = String.format("//%s:%d/foo", this.serverAddress.getHostName(), this.serverAddress.getPort());

        this.context.addServlet(new ServletHolder(new RedirectServlet(redirectPath)), servletPath);
        this.server.start();

        HttpURLConnection conn = openConnection(createURL(servletPath));

        assertEquals(302, conn.getResponseCode());
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.servlet.ServletHolder$Config

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.