Package org.mortbay.jetty.servlet

Examples of org.mortbay.jetty.servlet.ServletMapping


    public void registerServletHolder(ServletHolder servletHolder, String servletName, Set<String> servletMappings, String objectName) throws Exception {
        webAppContext.getServletHandler().addServlet(servletHolder);
        if (servletMappings != null) {
            for (String urlPattern : servletMappings) {
                ServletMapping servletMapping = new ServletMapping();
                servletMapping.setPathSpec(urlPattern);
                servletMapping.setServletName(servletName);
                this.webAppContext.getServletHandler().addServletMapping(servletMapping);
            }
        }
//        LifecycleCommand lifecycleCommand = new LifecycleCommand.StartCommand(servletHolder);
//        lifecycleChain.lifecycleCommand(lifecycleCommand);
View Full Code Here


    /* ------------------------------------------------------------ */
    protected void initServletMapping(XmlParser.Node node)
    {
        String servlet_name = node.getString("servlet-name",false,true);
        ServletMapping mapping = new ServletMapping();
        mapping.setServletName(servlet_name);

        ArrayList paths = new ArrayList();
        Iterator iter=node.iterator("url-pattern");
        while(iter.hasNext())
        {
            String p=((XmlParser.Node)iter.next()).toString(false,true);
            p=normalizePattern(p);
            paths.add(p);
        }
        mapping.setPathSpecs((String[])paths.toArray(new String[paths.size()]));

        _servletMappings=LazyList.add(_servletMappings,mapping);
    }
View Full Code Here

        if (LazyList.size(paths)>0)
        {
            String jspName=getJSPServletName();
            if (jspName!=null)
            {
                ServletMapping mapping = new ServletMapping();
                mapping.setServletName(jspName);
                mapping.setPathSpecs(LazyList.toStringArray(paths));
                _servletMappings=LazyList.add(_servletMappings,mapping);
            }
        }
    }
View Full Code Here

        } else {
            holder = new ServletHolder(servlet);
        }
        servletHandler.addServlet(holder);
       
        ServletMapping mapping = new ServletMapping();
        mapping.setServletName(holder.getName());
        String path = uri.getPath();
       
        if (!path.startsWith("/")) {
            path = '/' + path;
        }
       
        if (!path.startsWith(contextPath)) {
            path = contextPath + path;
       
               
        mapping.setPathSpec(path);
        servletHandler.addServletMapping(mapping);
       
        // Compute the complete URL
        String host;
        try {
View Full Code Here

    /* ------------------------------------------------------------ */
    protected void initServletMapping(XmlParser.Node node)
    {
        String servlet_name = node.getString("servlet-name",false,true);
        ServletMapping mapping = new ServletMapping();
        mapping.setServletName(servlet_name);

        ArrayList paths = new ArrayList();
        Iterator iter=node.iterator("url-pattern");
        while(iter.hasNext())
        {
            String p=((XmlParser.Node)iter.next()).toString(false,true);
            p=normalizePattern(p);
            paths.add(p);
        }
        mapping.setPathSpecs((String[])paths.toArray(new String[paths.size()]));

        _servletMappings=LazyList.add(_servletMappings,mapping);
    }
View Full Code Here

        if (LazyList.size(paths)>0)
        {
            String jspName=getJSPServletName();
            if (jspName!=null)
            {
                ServletMapping mapping = new ServletMapping();
                mapping.setServletName(jspName);
                mapping.setPathSpecs(LazyList.toStringArray(paths));
                _servletMappings=LazyList.add(_servletMappings,mapping);
            }
        }
    }
View Full Code Here

        } else {
            holder = new ServletHolder(servlet);
        }
        servletHandler.addServlet(holder);
       
        ServletMapping mapping = new ServletMapping();
        mapping.setServletName(holder.getName());
        String path = uri.getPath();
       
        if (!path.startsWith("/")) {
            path = '/' + path;
        }
       
        if (!path.startsWith(contextPath)) {
            path = contextPath + path;
       
               
        mapping.setPathSpec(path);
        servletHandler.addServletMapping(mapping);
       
        // Compute the complete URL
        String host;
        try {
View Full Code Here

        } else {
            holder = new ServletHolder(servlet);
        }
        servletHandler.addServlet(holder);

        ServletMapping mapping = new ServletMapping();
        mapping.setServletName(holder.getName());
        String path = uri.getPath();

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

        if (!path.startsWith(contextPath)) {
            path = contextPath + path;
        }

        mapping.setPathSpec(path);
        servletHandler.addServletMapping(mapping);

        // Compute the complete URL
        if (host == null) {
            try {
View Full Code Here

            }
        }

        ServletHolder holder = new ServletHolder(servlet);
        servletHandler.addServlet(holder);
        ServletMapping mapping = new ServletMapping();
        mapping.setServletName(holder.getName());
        String path = uri.getPath();
        mapping.setPathSpec(path);
        servletHandler.addServletMapping(mapping);
    }
View Full Code Here

        ServletHolder holder = new ServletHolder();
        holder.setName("jbiServlet");
        holder.setClassName(HttpBridgeServlet.class.getName());
        ServletHandler handler = new ServletHandler();
        handler.setServlets(new ServletHolder[] { holder });
        ServletMapping mapping = new ServletMapping();
        mapping.setServletName("jbiServlet");
        mapping.setPathSpec("/*");
        handler.setServletMappings(new ServletMapping[] { mapping });
        if (processor.getAuthMethod() != null) {
            SecurityHandler secHandler = new SecurityHandler();
            ConstraintMapping constraintMapping = new ConstraintMapping();
            Constraint constraint = new Constraint();
View Full Code Here

TOP

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

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.