Package org.apache.catalina.core

Examples of org.apache.catalina.core.StandardWrapper


            } catch (Throwable t) {
                getLogger().error("createWrapper", t);
                return (null);
            }
        } else {
            wrapper = new StandardWrapper();
        }

        synchronized (instanceListenersLock) {
            for (String instanceListener: findInstanceListeners()) {
                try {
View Full Code Here


        // Create the mbeans for servlets
        if( jsr77Names ) {
            Container childs[]=context.findChildren();
            for( int i=0; i<childs.length; i++ ) {
                StandardWrapper wrapper=(StandardWrapper)childs[i];
                // XXX prevent duplicated registration
                if( debug > 0 )
                    log("Register child wrapper (findChildren)" + wrapper);
                MBeanUtils.createMBean( wrapper );
            }
View Full Code Here

          Util.bind(envCtx, "security/realmMapping", new LinkRef(securityDomain));
          Util.bind(envCtx, "security/security-domain", new LinkRef(securityDomain));
          Util.bind(envCtx, "security/subject", new LinkRef(securityDomain));
    }
   
      StandardWrapper sw = (StandardWrapper) ctx.createWrapper();
   
    sw.setServletClass(dispatchServletClassName);
    sw.setName("default");
    ctx.addChild(sw);
    ctx.getServletContext().setAttribute("config", this.getConfig());

    sw.addInitParameter("listings", "false");
    sw.setLoadOnStartup(1);

    try {
      sw.start();
    } catch (LifecycleException e) {
      logger.error("Unexpected error when start the default servlet");
      throw e;
    }
    ctx.addServletMapping("/", "default");
View Full Code Here

        context.setManager(sessionMgr);
        context.getServletContext().setAttribute("_serverId", appInfo.server);
        context.getServletContext().setAttribute("componentName", appInfo.componentConfig.getComponentName());

        // create the Default Servlet instance to mount
        StandardWrapper defaultServlet = new StandardWrapper();
        defaultServlet.setServletClass("org.apache.catalina.servlets.DefaultServlet");
        defaultServlet.setServletName("default");
        defaultServlet.setLoadOnStartup(1);
        defaultServlet.addInitParameter("debug", "0");
        defaultServlet.addInitParameter("listing", "true");
        defaultServlet.addMapping("/");
        context.addChild(defaultServlet);
        context.addServletMapping("/", "default");

        // create the Jasper Servlet instance to mount
        StandardWrapper jspServlet = new StandardWrapper();
        jspServlet.setServletClass("org.apache.jasper.servlet.JspServlet");
        jspServlet.setServletName("jsp");
        jspServlet.setLoadOnStartup(1);
        jspServlet.addInitParameter("fork", "false");
        jspServlet.addInitParameter("xpoweredBy", "true");
        jspServlet.addMapping("*.jsp");
        jspServlet.addMapping("*.jspx");
        context.addChild(jspServlet);
        context.addServletMapping("*.jsp", "jsp");

        // default mime-type mappings
        configureMimeTypes(context);
View Full Code Here

            } catch (Throwable t) {
                getLogger().error("createWrapper", t);
                return (null);
            }
        } else {
            wrapper = new StandardWrapper();
        }
        synchronized (instanceListenersLock) {
            for (String instanceListener : findInstanceListeners()) {
                try {
                    InstanceListener listener = (InstanceListener) getInstanceManager().newInstance(instanceListener);
View Full Code Here

        context.setManager(sessionMgr);
        context.getServletContext().setAttribute("_serverId", appInfo.server);
        context.getServletContext().setAttribute("componentName", appInfo.componentConfig.getComponentName());

        // create the Default Servlet instance to mount
        StandardWrapper defaultServlet = new StandardWrapper();
        defaultServlet.setServletClass("org.apache.catalina.servlets.DefaultServlet");
        defaultServlet.setServletName("default");
        defaultServlet.setLoadOnStartup(1);
        defaultServlet.addInitParameter("debug", "0");
        defaultServlet.addInitParameter("listing", "true");
        defaultServlet.addMapping("/");
        context.addChild(defaultServlet);
        context.addServletMapping("/", "default");

        // create the Jasper Servlet instance to mount
        StandardWrapper jspServlet = new StandardWrapper();
        jspServlet.setServletClass("org.apache.jasper.servlet.JspServlet");
        jspServlet.setServletName("jsp");
        jspServlet.setLoadOnStartup(1);
        jspServlet.addInitParameter("fork", "false");
        jspServlet.addInitParameter("xpoweredBy", "true");
        jspServlet.addMapping("*.jsp");
        jspServlet.addMapping("*.jspx");
        context.addChild(jspServlet);
        context.addServletMapping("*.jsp", "jsp");

        // default mime-type mappings
        configureMimeTypes(context);
View Full Code Here

        // Create the mbeans for servlets
        if( jsr77Names ) {
            Container childs[]=context.findChildren();
            for( int i=0; i<childs.length; i++ ) {
                StandardWrapper wrapper=(StandardWrapper)childs[i];
                // XXX prevent duplicated registration
                if( debug > 0 )
                    log("Register child wrapper (findChildren)" + wrapper);
                MBeanUtils.createMBean( wrapper );
            }
View Full Code Here

        // Create the mbeans for servlets
        if( jsr77Names ) {
            Container childs[]=context.findChildren();
            for( int i=0; i<childs.length; i++ ) {
                StandardWrapper wrapper=(StandardWrapper)childs[i];
                // XXX prevent duplicated registration
                if( debug > 0 )
                    log("Register child wrapper (findChildren)" + wrapper);
                MBeanUtils.createMBean( wrapper );
            }
View Full Code Here

     * Process the annotations for the servlets.
     */
    protected static void loadApplicationServletAnnotations(Context context) {
       
        ClassLoader classLoader = context.getLoader().getClassLoader();
        StandardWrapper wrapper = null;
        Class classClass = null;
       
        Container[] children = context.findChildren();
        for (int i = 0; i < children.length; i++) {
            if (children[i] instanceof StandardWrapper) {
               
                wrapper = (StandardWrapper) children[i];
                if (wrapper.getServletClass() == null) {
                    continue;
                }
               
                try {
                    classClass = classLoader.loadClass(wrapper.getServletClass());
                } catch (ClassNotFoundException e) {
                    // We do nothing
                } catch (NoClassDefFoundError e) {
                    // We do nothing
                }
               
                if (classClass == null) {
                    continue;
                }
               
                loadClassAnnotation(context, wrapper.getServletClass());
                /* Process RunAs annotation which can be only on servlets.
                 * Ref JSR 250, equivalent to the run-as element in
                 * the deployment descriptor
                 */
                if (classClass.isAnnotationPresent(RunAs.class)) {
                    RunAs annotation = (RunAs)
                        classClass.getAnnotation(RunAs.class);
                    wrapper.setRunAs(annotation.value());
                }
            }
        }
       
       
View Full Code Here

            (String) request.getAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR);
        mb.setString(webContext.getName() + dispatchPath);
       
        try {
            mapper.map(mb, mappingData);
            StandardWrapper wrapper = (StandardWrapper) mappingData.wrapper;
            return wrapper.getName();
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
View Full Code Here

TOP

Related Classes of org.apache.catalina.core.StandardWrapper

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.