Package org.apache.catalina

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


    servlet.setName("default");
    servlet.setServletClass( "org.apache.catalina.servlets.DefaultServlet");
    servlet.setLoadOnStartup(1);
    servlet.addInitParameter("debug", "0");
    servlet.addInitParameter("listings", "false");
    context.addChild(servlet);
    context.addServletMapping("/", "default");

    // Create a handler for jsps
    Wrapper jspServlet = context.createWrapper();
    jspServlet.setName("jsp");
View Full Code Here


    jspServlet.setName("jsp");
    jspServlet.setServletClass( "org.apache.jasper.servlet.JspServlet");
    jspServlet.addInitParameter("fork", "false");
    jspServlet.addInitParameter("xpoweredBy", "false");
    jspServlet.setLoadOnStartup(2);
    context.addChild(jspServlet);
    context.addServletMapping("*.jsp", "jsp");
    context.addServletMapping("*.jspx", "jsp");

    // Set seme default welcome files
    context.addWelcomeFile("index.html");
View Full Code Here

        }

        wrapper = context.createWrapper();
        wrapper.setName(HESSIAN.replace("/", "") + "_" + name);
        wrapper.setServlet(new OpenEJBHessianServlet(listener));
        context.addChild(wrapper);
        context.addServletMapping(servletMapping, wrapper.getName());

        if ("BASIC".equals(authMethod) && StandardContext.class.isInstance(context)) {
            final StandardContext standardContext = StandardContext.class.cast(context);
View Full Code Here

        }

        wrapper = context.createWrapper();
        wrapper.setName(HESSIAN.replace("/", "") + "_" + name);
        wrapper.setServlet(new OpenEJBHessianServlet(listener));
        context.addChild(wrapper);
        context.addServletMapping(servletMapping, wrapper.getName());

        if ("BASIC".equals(authMethod) && StandardContext.class.isInstance(context)) {
            final StandardContext standardContext = StandardContext.class.cast(context);
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

    ContextConfig ctxCfg = new ContextConfig();
    ctxCfg.setDefaultWebXml(Constants.NoDefaultWebXml);
    context.addLifecycleListener(ctxCfg);

    Wrapper sw = context.createWrapper();
    context.addChild(sw);
    sw.setServletClass("com.example.demo.ClassLoaderServlet");
    sw.setName("info");
    sw.setLoadOnStartup(1);
    sw.addMapping("/info");
     
View Full Code Here

    ContextConfig ctxCfg = new ContextConfig();
    ctxCfg.setDefaultWebXml(Constants.NoDefaultWebXml);
    context.addLifecycleListener(ctxCfg);

    Wrapper sw = context.createWrapper();
    context.addChild(sw);
    sw.setServletClass("com.example.demo.ClassLoaderServlet");
    sw.setName("info");
    sw.setLoadOnStartup(1);
    sw.addMapping("/info");
     
View Full Code Here

        w.addInitParameter("readonly", "false");
        w.addInitParameter("listings", "true");

        w.setLoadOnStartup(0);

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

        Connector connector = embedded.createConnector("127.0.0.1", port1, Http11NioProtocol.class.getName());
        connector.setContainer(host);
        embedded.addEngine(engine);
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

        Context ctx = tomcat.addContext("", null);

        StandardWrapper wrapper = new StandardWrapper();
        wrapper.setServletName("Bug51445");
        wrapper.setServletClass(Bug51445Servlet.class.getName());
        ctx.addChild(wrapper);
        ctx.addServletMapping("/", "Bug51445");

        tomcat.start();

        // Start the threads
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.