code: private FilterChain getChainForPath(int requestType, String pathInContext, ServletHolder servletHolder) 
      {
          if (_filterChainsCached)
          {
              synchronized(this)
              {
                  if(_chainCache[requestType].containsKey(pathInContext))
                      return (FilterChain)_chainCache[requestType].get(pathInContext);
              }
          }
          
          // Build list of filters
          Object filters= null;
      
          // Path filters
          for (int i= 0; i < _pathFilters.size(); i++)
          {
              FilterMapping mapping = (FilterMapping)_pathFilters.get(i);
              if (mapping.appliesTo(pathInContext, requestType))
                  filters= LazyList.add(filters, mapping.getHolder());
          }
          
          // Servlet filters
          if (servletHolder != null && _servletFilterMap.size() > 0)
          {
              Object o= _servletFilterMap.get(servletHolder.getName());
              for (int i=0; i<LazyList.size(o);i++)
              {
                  FilterMapping mapping = (FilterMapping)LazyList.get(o,i);
                  if (mapping.appliesTo(null,requestType))
                      filters=LazyList.add(filters,mapping.getHolder());
              }
          }
          
          FilterChain chain = null;
          if (_filterChainsCached)
          {
              synchronized(this)
              {
                  if (LazyList.size(filters) > 0)
                      chain= new CachedChain(filters, servletHolder);
                  _chainCache[requestType].put(pathInContext,chain);
              }
          }
          else if (LazyList.size(filters) > 0)
              chain = new Chain(filters, servletHolder);
      
          return chain;
      }
docs: /* ------------------------------------------------------------