Package org.mortbay.jetty.servlet

Examples of org.mortbay.jetty.servlet.DefaultServlet


            if (!servletPath.startsWith("/")) {
                servletPath = '/' + servletPath;
            }    
      
            DefaultResourceServlet resourceServlet = (DefaultResourceServlet)servlet;
            DefaultServlet defaultServlet = new JettyDefaultServlet(servletPath, resourceServlet.getDocumentRoot());
            holder = new ServletHolder(defaultServlet);
           
        } else {
            holder = new ServletHolder(servlet);
        }
View Full Code Here


            if (!servletPath.startsWith("/")) {
                servletPath = '/' + servletPath;
            }

            DefaultResourceServlet resourceServlet = (DefaultResourceServlet)servlet;
            DefaultServlet defaultServlet = new JettyDefaultServlet(servletPath, resourceServlet.getDocumentRoot());
            holder = new ServletHolder(defaultServlet);

        } else {
            holder = new ServletHolder(servlet);
        }
View Full Code Here

    Context context = new Context(server, "/", Context.SESSIONS);
    //context.setBaseResource(Resource.newClassPathResource("/endtoend"));
    context.setResourceBase(Resource.newClassPathResource("/endtoend").getFile().getAbsolutePath());

    ServletHolder defaultHolder = new ServletHolder(new DefaultServlet());
    context.addServlet(defaultHolder, "/");

    context.addEventListener(new GuiceServletContextListener());
                                                                                                  
    Map<String, String> initParams = Maps.newHashMap();
    String modules = Joiner.on(":")
        .join(SampleModule.class.getName(), DefaultGuiceModule.class.getName(),
            PropertiesModule.class.getName(), OAuthModule.class.getName());

    initParams.put(GuiceServletContextListener.MODULES_ATTRIBUTE, modules);
    context.setInitParams(initParams);

    // Attach the ConcatProxyServlet - needed for rewriting
    ServletHolder concatHolder = new ServletHolder(new ConcatProxyServlet());
    context.addServlet(concatHolder, CONCAT_BASE);

    // Attach the JS
    ServletHolder jsHolder = new ServletHolder(new JsServlet());
    context.addServlet(jsHolder, JS_BASE);

    // Attach the metatdata handler
    ServletHolder metadataHolder = new ServletHolder(new RpcServlet());
    context.addServlet(metadataHolder, METADATA_BASE);

    // Attach the Proxy
    ServletHolder proxyHolder = new ServletHolder(new ProxyServlet());
    context.addServlet(proxyHolder, PROXY_BASE);

    // Attach the gadget rendering servlet
    ServletHolder gadgetServletHolder = new ServletHolder(new GadgetRenderingServlet());
    context.addServlet(gadgetServletHolder, GADGET_BASE);
    context.addFilter(AuthenticationServletFilter.class, GADGET_BASE, 0);

    // Attach the html acceleration rendering servlet
    ServletHolder accelServletHolder = new ServletHolder(new HtmlAccelServlet());
    context.addServlet(accelServletHolder, ACCEL_BASE);
    context.addFilter(AuthenticationServletFilter.class, ACCEL_BASE, 0);

    // Attach the make-request servlet
    ServletHolder makeRequestHolder = new ServletHolder(new MakeRequestServlet());
    context.addServlet(makeRequestHolder, MAKEREQUEST_BASE);
    context.addFilter(AuthenticationServletFilter.class, MAKEREQUEST_BASE, 0);

    // Attach the gadgets rpc servlet
    ServletHolder gadgetsRpcServletHolder = new ServletHolder(new JsonRpcServlet());
    gadgetsRpcServletHolder.setInitParameter("handlers", "org.apache.shindig.gadgets.handlers");
    context.addServlet(gadgetsRpcServletHolder, GADGETS_RPC_BASE);
    context.addFilter(AuthenticationServletFilter.class, GADGETS_RPC_BASE, 0);

    // Attach the gadgets rest servlet
    ServletHolder gadgetsRestServletHolder = new ServletHolder(new DataServiceServlet());
    gadgetsRestServletHolder.setInitParameter("handlers", "org.apache.shindig.gadgets.handlers");
    context.addServlet(gadgetsRestServletHolder, GADGETS_REST_BASE);
    context.addFilter(AuthenticationServletFilter.class, GADGETS_REST_BASE, 0);
   
    // Attach DataServiceServlet
    ServletHolder restServletHolder = new ServletHolder(new DataServiceServlet());
    restServletHolder.setInitParameter("handlers", "org.apache.shindig.social.handlers");
    context.addServlet(restServletHolder, REST_BASE);
    context.addFilter(AuthenticationServletFilter.class, REST_BASE, 0);

    // Attach JsonRpcServlet
    ServletHolder rpcServletHolder = new ServletHolder(new JsonRpcServlet());
    rpcServletHolder.setInitParameter("handlers", "org.apache.shindig.social.handlers");
    context.addServlet(rpcServletHolder, JSON_RPC_BASE);
    context.addFilter(AuthenticationServletFilter.class, JSON_RPC_BASE, 0);

    DefaultServlet defaultServlet = new DefaultServlet() {
      public Resource getResource(String s) {
        // Skip Gzip
        if (s.endsWith(".gz")) return null;
       
        String stripped = s.substring("/gadgets/files/".length());
View Full Code Here

            if (!servletPath.startsWith("/")) {
                servletPath = '/' + servletPath;
            }    
      
            DefaultResourceServlet resourceServlet = (DefaultResourceServlet)servlet;
            DefaultServlet defaultServlet = new JettyDefaultServlet(servletPath, resourceServlet.getDocumentRoot());
            holder = new ServletHolder(defaultServlet);
           
        } else {
            holder = new ServletHolder(servlet);
        }
View Full Code Here

            if (!servletPath.startsWith("/")) {
                servletPath = '/' + servletPath;
            }    
      
            DefaultResourceServlet resourceServlet = (DefaultResourceServlet)servlet;
            DefaultServlet defaultServlet = new JettyDefaultServlet(servletPath, resourceServlet.getDocumentRoot());
            holder = new ServletHolder(defaultServlet);
           
        } else {
            holder = new ServletHolder(servlet);
        }
View Full Code Here

            if (!servletPath.startsWith("/")) {
                servletPath = '/' + servletPath;
            }

            DefaultResourceServlet resourceServlet = (DefaultResourceServlet)servlet;
            DefaultServlet defaultServlet = new JettyDefaultServlet(servletPath, resourceServlet.getDocumentRoot());
            holder = new ServletHolder(defaultServlet);

        } else {
            holder = new ServletHolder(servlet);
        }
View Full Code Here

            }
            if (servletPath.endsWith("/")) {
                servletPath = servletPath.substring(0, servletPath.length()-1);
            }
            DefaultResourceServlet resourceServlet = (DefaultResourceServlet)servlet;
            DefaultServlet defaultServlet = new JettyDefaultServlet(servletPath, resourceServlet.getDocumentRoot());
            holder = new ServletHolder(defaultServlet);
           
        } else {
            holder = new ServletHolder(servlet);
        }
View Full Code Here

            if (!servletPath.startsWith("/")) {
                servletPath = '/' + servletPath;
            }    
      
            DefaultResourceServlet resourceServlet = (DefaultResourceServlet)servlet;
            DefaultServlet defaultServlet = new JettyDefaultServlet(servletPath, resourceServlet.getDocumentRoot());
            holder = new ServletHolder(defaultServlet);
           
        } else {
            holder = new ServletHolder(servlet);
        }
View Full Code Here

            }
            if (!servletPath.startsWith("/")) {
                servletPath = '/' + servletPath;
            }
            DefaultResourceServlet resourceServlet = (DefaultResourceServlet)servlet;
            DefaultServlet defaultServlet = new JettyDefaultServlet(servletPath, resourceServlet.getDocumentRoot());
            holder = new ServletHolder(defaultServlet);
           
        } else {
            holder = new ServletHolder(servlet);
        }
View Full Code Here

            if (!servletPath.startsWith("/")) {
                servletPath = '/' + servletPath;
            }    
      
            DefaultResourceServlet resourceServlet = (DefaultResourceServlet)servlet;
            DefaultServlet defaultServlet = new JettyDefaultServlet(servletPath, resourceServlet.getDocumentRoot());
            holder = new ServletHolder(defaultServlet);
           
        } else {
            holder = new ServletHolder(servlet);
        }
View Full Code Here

TOP

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

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.