Package org.apache.catalina

Examples of org.apache.catalina.Context.addChild()


        Wrapper w = c.createWrapper();
        w.addMapping("/*");
        w.setServletClass(TomcatAtmosphereServlet.class.getName());
        w.setLoadOnStartup(0);

        c.addChild(w);
        host.addChild(c);

        Connector connector = embedded.createConnector("127.0.0.1",port,Http11NioProtocol.class.getName());
        connector.setContainer(host);
        embedded.addEngine(engine);
View Full Code Here


        w.addMapping("/*");
        w.setServletClass(TomcatAtmosphereServlet.class.getName());
        w.setLoadOnStartup(0);
        //w.addInitParameter(CometSupport.MAX_INACTIVE, "20000");

        c.addChild(w);
        host.addChild(c);       

        Connector connector = embedded.createConnector("127.0.0.1",port,Http11NioProtocol.class.getName());
        connector.setContainer(host);
        embedded.addEngine(engine);
View Full Code Here

        setWsContainer(context, wrapper, httpListener);
        wrapper.addMapping("/*");


        // add add servlet to context
        context.addChild(wrapper);
        context.addServletMapping("/*", "webservice");

        // add context to host
        host.addChild(context);
        webserviceContexts.put(path, context);
View Full Code Here

        final String name = "rest_" + listener.hashCode();
        wrapper.setName(name);
        wrapper.setServletClass(RsServlet.class.getName());

        final String mapping = path.replace("/.*", "/*");
        context.addChild(wrapper);
        wrapper.addMapping(mapping);
        context.addServletMapping(mapping, name);

        final String listenerId = wrapper.getName() + RsServlet.class.getName() + listener.hashCode();
        wrapper.addInitParameter(HttpListener.class.getName(), listenerId);
View Full Code Here

        String contextPath = ctx.getPath();
        assert mapping.startsWith(contextPath);
        mapping = mapping.substring(contextPath.length());
        Wrapper wrapper = new TuscanyWrapper(servlet);
        wrapper.setName(mapping.substring(0,mapping.lastIndexOf('/')));
        ctx.addChild(wrapper);
        wrapper.addMapping(mapping);
        ctx.getMapper().addWrapper(mapping, wrapper, false);
    }

    public void unregisterMapping(String mapping) {
View Full Code Here

            wrapper = new ServletWrapper(servlet);
        }
        Context context = port.getHost().map(path);
        wrapper.setName(path);
        wrapper.addMapping(path);
        context.addChild(wrapper);
        context.addServletMapping(path, path);
        port.getConnector().getMapper().addWrapper("localhost", "", path, wrapper);

        // Initialize the servlet
        try {
View Full Code Here

        // Without a servlet the filter will not get run.
        final Wrapper wrapper = context.createWrapper();
        final String name = "DefaultServlet";
        wrapper.setName(name);
        wrapper.setServletClass(DefaultServlet.class.getName());
        context.addChild(wrapper);
        context.addServletMapping("/", name);

        File contextConfigFile = new File(webappFolder, "META-INF/context.xml");

        if (contextConfigFile.exists())
View Full Code Here

            wrapper = new ServletWrapper(servlet);
        }
        Context context = port.getHost().map(path);
        wrapper.setName(path);
        wrapper.addMapping(path);
        context.addChild(wrapper);
        context.addServletMapping(path, path);
        port.getConnector().getMapper().addWrapper("localhost", "", path, wrapper);

        // Initialize the servlet
        try {
View Full Code Here

            Context staticContext = container.createContext( staticContextPath, staticContextDocbase );
            staticContext.setPrivileged( true );
            Wrapper servlet = context.createWrapper();
            servlet.setServletClass( DefaultServlet.class.getName() );
            servlet.setName( "staticContent" );
            staticContext.addChild( servlet );
            staticContext.addServletMapping( "/", "staticContent" );
            host.addChild( staticContext );
        }
    }
View Full Code Here

            Context staticContext = container.addContext( staticContextPath, staticContextDocbase );
            staticContext.setPrivileged( true );
            Wrapper servlet = context.createWrapper();
            servlet.setServletClass( DefaultServlet.class.getName() );
            servlet.setName( "staticContent" );
            staticContext.addChild( servlet );
            staticContext.addServletMapping( "/", "staticContent" );
            host.addChild( staticContext );
        }
    }
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.