Package org.mortbay.jetty.servlet

Examples of org.mortbay.jetty.servlet.ServletHandler


        Context rootJettyContext = new Context( server, "/", Context.SESSIONS );

        rootJettyContext.setContextPath( "/" );
        rootJettyContext.setAttribute( PlexusConstants.PLEXUS_KEY, getContainer() );

        ServletHandler servletHandler = rootJettyContext.getServletHandler();

        ServletHolder holder = servletHandler.addServletWithMapping( BasicWebDavServlet.class, CONTEXT + "/*" );

        holder.setInitParameter( BasicWebDavServlet.INIT_ROOT_DIRECTORY, serverRepoDir.getAbsolutePath() );
        holder.setInitParameter( BasicWebDavServlet.INIT_USE_INDEX_HTML, "true" );

        server.start();
View Full Code Here


        Context rootJettyContext = new Context( server, "/", Context.SESSIONS );

        rootJettyContext.setContextPath( "/" );
        rootJettyContext.setAttribute( PlexusConstants.PLEXUS_KEY, getContainer() );

        ServletHandler servletHandler = rootJettyContext.getServletHandler();

        ServletHolder holder = servletHandler.addServletWithMapping( BasicWebDavServlet.class, CONTEXT + "/*" );

        holder.setInitParameter( "dav.root", serverRepoDir.getAbsolutePath() );
       
        server.start();
       
View Full Code Here

        System.setProperty( "DEBUG", "" );
        System.setProperty( "org.mortbay.log.class", "org.slf4j.impl.SimpleLogger" );

        server = new Server( PORT );
        Context root = new Context( server, "/", Context.SESSIONS );
        ServletHandler servletHandler = root.getServletHandler();
        root.setContextPath( "/" );
        root.setAttribute( PlexusConstants.PLEXUS_KEY, container );
       
        // ----------------------------------------------------------------------------
        // Configure the webdav servlet
        // ----------------------------------------------------------------------------

        ServletHolder holder = servletHandler.addServletWithMapping( BasicWebDavServlet.class, "/projects/*" );

        // Initialize server contents directory.
        File serverContentsDir = new File( "target/test-server/" );

        FileUtils.deleteDirectory( serverContentsDir );
View Full Code Here

        Context rootJettyContext = new Context( server, "/", Context.SESSIONS );

        rootJettyContext.setContextPath( "/" );
        rootJettyContext.setAttribute( PlexusConstants.PLEXUS_KEY, getContainer() );

        ServletHandler servletHandler = rootJettyContext.getServletHandler();

        ServletHolder holder = servletHandler.addServletWithMapping( TestMultiWebDavServlet.class, CONTEXT + "/*" );
        holder.setInitParameter( "root.sandbox", serverSandboxDir.getAbsolutePath() );
        holder.setInitParameter( "root.snapshots", serverSnapshotsDir.getAbsolutePath() );

        System.out.println( "root.sandbox = " + serverSandboxDir.getAbsolutePath() );
        System.out.println( "root.snapshots = " + serverSnapshotsDir.getAbsolutePath() );
View Full Code Here

  public void setUp() throws Exception {

    ContextHandler context = new ContextHandler();
    context.setContextPath("/");
    context.setResourceBase(RES_DIR);
    ServletHandler sh = new ServletHandler();
    sh.addServlet("org.apache.jasper.servlet.JspServlet", "*.jsp");
    context.addHandler(sh);
    context.addHandler(new SessionHandler());

    server = new Server();
    server.addHandler(context);
View Full Code Here

        LOG.warn("Skipping segment '" + p + "': " + StringUtils.stringifyException(e));
      }
    }
    if (forward) {
      LOG.info("* Adding forwarding proxy for all unknown urls ...");
      ServletHandler servlets = new ServletHandler();
      servlets.addServletWithMapping(AsyncProxyServlet.class, "/*");
      servlets.addFilterWithMapping(LogDebugHandler.class, "/*", Handler.ALL);
      list.addHandler(servlets);
    }
    if (fake) {
      LOG.info("* Added fake handler for remaining URLs.");
      list.addHandler(new FakeHandler());
View Full Code Here

    }
    webAppContext.addServlet(holder, pathSpec);

    if(requireAuth && UserGroupInformation.isSecurityEnabled()) {
       LOG.info("Adding Kerberos (SPNEGO) filter to " + name);
       ServletHandler handler = webAppContext.getServletHandler();
       FilterMapping fmap = new FilterMapping();
       fmap.setPathSpec(pathSpec);
       fmap.setFilterName(SPNEGO_FILTER);
       fmap.setDispatches(Handler.ALL);
       handler.addFilterMapping(fmap);
    }
  }
View Full Code Here

    holder.setInitParameters(parameters);
    FilterMapping fmap = new FilterMapping();
    fmap.setPathSpecs(urls);
    fmap.setDispatches(Handler.ALL);
    fmap.setFilterName(name);
    ServletHandler handler = ctx.getServletHandler();
    handler.addFilter(holder, fmap);
  }
View Full Code Here

   * @param pathSpec The path spec
   * @param webAppCtx The WebApplicationContext to add to
   */
  protected void addFilterPathMapping(String pathSpec,
      Context webAppCtx) {
    ServletHandler handler = webAppCtx.getServletHandler();
    for(String name : filterNames) {
      FilterMapping fmap = new FilterMapping();
      fmap.setPathSpec(pathSpec);
      fmap.setFilterName(name);
      fmap.setDispatches(Handler.ALL);
      handler.addFilterMapping(fmap);
    }
  }
View Full Code Here

    }
    webAppContext.addServlet(holder, pathSpec);

    if(requireAuth && UserGroupInformation.isSecurityEnabled()) {
       LOG.info("Adding Kerberos (SPNEGO) filter to " + name);
       ServletHandler handler = webAppContext.getServletHandler();
       FilterMapping fmap = new FilterMapping();
       fmap.setPathSpec(pathSpec);
       fmap.setFilterName(SPNEGO_FILTER);
       fmap.setDispatches(Handler.ALL);
       handler.addFilterMapping(fmap);
    }
  }
View Full Code Here

TOP

Related Classes of org.mortbay.jetty.servlet.ServletHandler

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.