Examples of FilterMapping


Examples of org.eclipse.jst.javaee.web.FilterMapping

    return null;
    }
   
    public static FilterMapping findFilterMapping(final WebApp webApp, final Filter filter) {
    for (Iterator it=webApp.getFilterMappings().iterator();it.hasNext();){
      FilterMapping mapping = (FilterMapping)it.next();
      if (mapping.getFilterName() != null &&
          filter.getFilterName() != null &&
          mapping.getFilterName().trim().equals(filter.getFilterName().trim()))
        return mapping;
        }
    return null;
    }
View Full Code Here

Examples of org.eclipse.jst.javaee.web.FilterMapping

            final List<String> urlMappingList, final Filter filter)
    {

        if (urlMappingList.size() > 0)
        {
            FilterMapping mapping = findFilterMapping(webApp, filter);
            if (mapping == null)
            {
                mapping = WebFactory.eINSTANCE.createFilterMapping();
                mapping.setFilterName(filter.getFilterName());
                webApp.getFilterMappings().add(mapping);
            }
            // Add patterns
            for (final String pattern : urlMappingList)
            {

                UrlPatternType urlPattern = JavaeeFactory.eINSTANCE
                        .createUrlPatternType();
                urlPattern.setValue(pattern);
                mapping.getUrlPatterns().add(urlPattern);
            }
        }
    }
View Full Code Here

Examples of org.mortbay.jetty.servlet.FilterMapping

    public void addFilter( final String pathSpec, final Filter filter )
    {
        String name = "filter" + filterCount++;

        FilterMapping fm = new FilterMapping();
        fm.setPathSpec( pathSpec );
        fm.setFilterName( name );

        FilterHolder fh = new FilterHolder( filter );
        fh.setName( name );

        webappContext.getServletHandler().addFilter( fh, fm );
View Full Code Here

Examples of org.mortbay.jetty.servlet.FilterMapping

    webAppContext.addServlet(holder, pathSpec);
   
    if(requireAuth && UserGroupInformation.isSecurityEnabled()) {
       LOG.info("Adding Kerberos filter to " + name);
       ServletHandler handler = webAppContext.getServletHandler();
       FilterMapping fmap = new FilterMapping();
       fmap.setPathSpec(pathSpec);
       fmap.setFilterName("krb5Filter");
       fmap.setDispatches(Handler.ALL);
       handler.addFilterMapping(fmap);
    }
  }
View Full Code Here

Examples of org.mortbay.jetty.servlet.FilterMapping

    FilterHolder holder = new FilterHolder();
    holder.setName(name);
    holder.setClassName(classname);
    holder.setInitParameters(parameters);
    FilterMapping fmap = new FilterMapping();
    fmap.setPathSpecs(urls);
    fmap.setDispatches(Handler.ALL);
    fmap.setFilterName(name);
    ServletHandler handler = ctx.getServletHandler();
    handler.addFilter(holder, fmap);
  }
View Full Code Here

Examples of org.mortbay.jetty.servlet.FilterMapping

   */
  protected void addFilterPathMapping(String pathSpec,
      Context webAppCtx) {
    ServletHandler handler = webAppCtx.getServletHandler();
    for(String name : filterNames) {
      FilterMapping fmap = new FilterMapping();
      fmap.setPathSpec(pathSpec);
      fmap.setFilterName(name);
      fmap.setDispatches(Handler.ALL);
      handler.addFilterMapping(fmap);
    }
  }
View Full Code Here

Examples of org.mortbay.jetty.servlet.FilterMapping

            final FilterHolder filterHolder = new FilterHolder(filterSpec.getFilterClass());
            filterHolder.setInitParameters(filterSpec.getInitParams());
            servletHandler.addFilter(filterHolder);

            final FilterMapping filterMapping = new FilterMapping();
            filterMapping.setFilterName(filterHolder.getName());
            filterMapping.setPathSpecs(filterSpec.getPathSpecs().toArray(new String[] {}));
            filterMapping.setDispatches(Handler.DEFAULT);
            servletHandler.addFilterMapping(filterMapping);
        }
    }
View Full Code Here

Examples of org.mortbay.jetty.servlet.FilterMapping

    FilterHolder holder = new FilterHolder();
    holder.setName(name);
    holder.setClassName(classname);
    holder.setInitParameters(parameters);
    FilterMapping fmap = new FilterMapping();
    fmap.setPathSpecs(urls);
    fmap.setDispatches(Handler.ALL);
    fmap.setFilterName(name);
    ServletHandler handler = ctx.getServletHandler();
    handler.addFilter(holder, fmap);
  }
View Full Code Here

Examples of org.mortbay.jetty.servlet.FilterMapping

   */
  protected void addFilterPathMapping(String pathSpec,
      Context webAppCtx) {
    ServletHandler handler = webAppCtx.getServletHandler();
    for(String name : filterNames) {
      FilterMapping fmap = new FilterMapping();
      fmap.setPathSpec(pathSpec);
      fmap.setFilterName(name);
      fmap.setDispatches(Handler.ALL);
      handler.addFilterMapping(fmap);
    }
  }
View Full Code Here

Examples of org.mortbay.jetty.servlet.FilterMapping

    {
        String filter_name=node.getString("filter-name",false,true);



        FilterMapping mapping = new FilterMapping();

        mapping.setFilterName(filter_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()]));


        ArrayList names = new ArrayList();
        iter=node.iterator("servlet-name");
        while(iter.hasNext())
        {
            String n=((XmlParser.Node)iter.next()).toString(false,true);
            names.add(n);
        }
        mapping.setServletNames((String[])names.toArray(new String[names.size()]));


        int dispatcher=Handler.DEFAULT;
        iter=node.iterator("dispatcher");
        while(iter.hasNext())
        {
            String d=((XmlParser.Node)iter.next()).toString(false,true);
            dispatcher|=Dispatcher.type(d);
        }
        mapping.setDispatches(dispatcher);

        _filterMappings=LazyList.add(_filterMappings,mapping);
    }
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.