Examples of ServletHandler


Examples of org.eclipse.jetty.servlet.ServletHandler

    }

    private void resetJettyFilterMappings() {
        //This causes jetty to recompute the filter to servlet mappings based on the
        //current servlet names in the filter mappings.  Pretty inefficient.
        ServletHandler servletHandler = jettyServletRegistration.getServletHandler();
        FilterMapping[] filterMappings = servletHandler.getFilterMappings();
        FilterMapping[] copy = filterMappings.clone();
        servletHandler.setFilterMappings(copy);
    }
View Full Code Here

Examples of org.eclipse.jetty.servlet.ServletHandler

            BuiltInAuthMethod builtInAuthMethod = BuiltInAuthMethod.getValueOf(authMethod);
            JettySecurityHandlerFactory  factory = new JettySecurityHandlerFactory(builtInAuthMethod, null, null, realmName, configurationFactory);
            //TODO use actual default subject here.
            securityHandler = factory.buildSecurityHandler(contextID, null, null, false);
        }
        ServletHandler servletHandler = new EJBServletHandler(webServiceContainer);
        EJBWebServiceContext webServiceContext = new EJBWebServiceContext(contextPath, securityHandler, servletHandler, classLoader);
        webServiceContext.setVirtualHosts(virtualHosts);
        addContext(webServiceContext);
        webServiceContext.start();
        webServices.put(contextPath, webServiceContext);
View Full Code Here

Examples of org.eclipse.jetty.servlet.ServletHandler

        } else {
            //TODO may need to turn off security with Context._options.
//            securityHandler = new NoSecurityHandler();
        }

        ServletHandler servletHandler = new ServletHandler();

        //wrap the web app context with the jndi handler
        GeronimoUserTransaction userTransaction = new GeronimoUserTransaction(transactionManager);
        this.componentContext = EnterpriseNamingContext.createEnterpriseNamingContext(componentContext, userTransaction, kernel, classLoader);
        integrationContext = new IntegrationContext(this.componentContext, unshareableResources, applicationManagedSecurityResources, trackedConnectionAssociator, userTransaction);
View Full Code Here

Examples of org.eclipse.jetty.servlet.ServletHandler

  private int port;
  private String host;
  private Directory serverIndexDir, handlerIndexDir;
 
  private void startServer() throws Exception {
    ServletHandler replicationHandler = new ServletHandler();
    ReplicationService service = new ReplicationService(Collections.singletonMap("s1", serverReplicator));
    ServletHolder servlet = new ServletHolder(new ReplicationServlet(service));
    replicationHandler.addServletWithMapping(servlet, ReplicationService.REPLICATION_CONTEXT + "/*");
    server = newHttpServer(replicationHandler);
    port = serverPort(server);
    host = serverHost(server);
  }
View Full Code Here

Examples of org.glassfish.grizzly.servlet.ServletHandler

        /**
         * Instantiates the Grizzly 2 Web Server
         */
        private void instantiateGrizzlyWebServer() {

            final ServletHandler handler = new ServletHandler();

            Servlet servletInstance;
            if( servletClass != null) {
                try {
                    servletInstance = (Servlet) servletClass.newInstance();
                } catch (InstantiationException ex) {
                    throw new TestContainerException(ex);
                } catch (IllegalAccessException ex) {
                    throw new TestContainerException(ex);
                }
                handler.setServletInstance(servletInstance);
            }

            for(Class<? extends EventListener> eventListener : eventListeners) {
                handler.addServletListener(eventListener.getName());
            }

            for(String contextParamName : contextParams.keySet()) {
                handler.addContextParameter(contextParamName, contextParams.get(contextParamName));
            }

            for(String initParamName : initParams.keySet()) {
                handler.addInitParameter(initParamName, initParams.get(initParamName));
            }

            if(contextPath != null && contextPath.length() > 0) {
                if( !contextPath.startsWith("/") ) {
                    handler.setContextPath("/" + contextPath);
                } else {
                    handler.setContextPath(contextPath);
                }
            }

            if(servletPath != null && servletPath.length() > 0) {
                if( !servletPath.startsWith("/") ) {
                    handler.setServletPath("/" + servletPath);
                } else {
                    handler.setServletPath(servletPath);
                }
            }

            // Filter support
            if ( filters!=null ) {
                try {
                    for(WebAppDescriptor.FilterDescriptor d : this.filters) {
                        handler.addFilter(d.getFilterClass().newInstance(), d.getFilterName(), d.getInitParams());
                    }
                } catch (InstantiationException ex) {
                    throw new TestContainerException(ex);
                } catch (IllegalAccessException ex) {
                    throw new TestContainerException(ex);
View Full Code Here

Examples of org.mortbay.jetty.plus.servlet.ServletHandler

    public void setWebAppContext (WebAppContext context)
    {
        super.setWebAppContext(context);
       
        //set up our special ServletHandler to remember injections and lifecycle callbacks
        ServletHandler servletHandler = new ServletHandler();
        SecurityHandler securityHandler = getWebAppContext().getSecurityHandler();       
        org.mortbay.jetty.servlet.ServletHandler existingHandler = getWebAppContext().getServletHandler();
        servletHandler.setFilters(existingHandler.getFilters());
        servletHandler.setFilterMappings(existingHandler.getFilterMappings());
        servletHandler.setServlets(existingHandler.getServlets());
        servletHandler.setServletMappings(existingHandler.getServletMappings());
        getWebAppContext().setServletHandler(servletHandler);
        securityHandler.setHandler(servletHandler);      
    }
View Full Code Here

Examples of org.mortbay.jetty.servlet.ServletHandler

                        staticContext.start();
                    }
                   
                    appContext = context.addContext(pathPattern, "");

                    ServletHandler handler = new ServletHandler();
                    Class servletClass = servletClassName == null ?
                            EmbeddedServletClient.class : Class.forName(servletClassName);

                    ServletHolder holder = new ServletHolder(servletClass);
                    handler.addServletWithMapping(holder, "/*");

                    holder.setInitParameter("application", appName);
                    // holder.setInitParameter("mountpoint", mountpoint);

                    if (cookieDomain != null) {
View Full Code Here

Examples of org.mortbay.jetty.servlet.ServletHandler

    ContextHandler contextHandler = new ContextHandler();
    contextHandler.setContextPath( "" );
    server.addHandler( contextHandler );

    // Create a servlet container
    ServletHandler servlets = new ServletHandler();
    contextHandler.addHandler( servlets );

    contextHandler.setAttribute( "queryEngine", queryEngine );
    contextHandler.setAttribute( "collection", collection );
    contextHandler.setAttribute( "titleList", titleList );
    contextHandler.setAttribute( "action", "/Query" );
    // TODO: very rudimentary: we should get the template from somewhere else instead...
    contextHandler.setAttribute( "template", System.getProperty( "it.unimi.dsi.mg4j.query.QueryServlet.template" ) );

    // Maps the main servlet onto the container.
    servlets.addServletWithMapping( QueryServlet.class, "/Query" );
    servlets.addServletWithMapping( HelpPage.class, "/Help" );
   
    /* If an item servlet was specified, we link it to /Item. Otherwise,
     * we inform the query servlet that it should generate direct URIs. */

    if ( itemClass != null ) {
      servlets.addServletWithMapping( itemClass, "/Item" );
      if ( itemClass == FileSystemItem.class ) contextHandler.setAttribute( "derelativise", Boolean.TRUE );
    }
    else contextHandler.setAttribute( "uri", Boolean.TRUE );

    contextHandler.setAttribute( "mimeType", itemMimeType );
View Full Code Here

Examples of org.mortbay.jetty.servlet.ServletHandler

        getServiceRegistry().register(service);

        // Create the server
        server = new Server(8391);
        ServletHandler handler = new ServletHandler ();
       
        Context context = new Context(server,"/",Context.SESSIONS);
       
        ServletHolder servlet = new ServletHolder(new XFireServlet());
        handler.addServlet(servlet);
       
        context.addServlet(servlet, "/*");
       
        context.addFilter("com.planetj.servlet.filter.compression.CompressingFilter", "/*", 0);
       
View Full Code Here

Examples of org.mortbay.jetty.servlet.ServletHandler

        httpContext.setRedirectNullPath(false);
        server.addContext(httpContext);

        // Dunny servlet handler for faking HttpServletRequest,
        // HttpServletResponse
        servletHandler = new ServletHandler();
        servletHandler.initialize(httpContext);
        servletHandler.start();

        // Add the webapp
        webappContext = new CustomWebApplicationContext(useDevConfig, bootLoader);
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.