config-prettyfaces/src/main/java/com/ocpsoft/pretty/faces/config/PrettyConfig.java
public UrlMapping getMappingForUrl(final URL url)
   {
      final String mappingKey = url.toURL();
      if (cachedMappings.containsKey(mappingKey)) {
         return cachedMappings.get(mappingKey);
      }
      for (UrlMapping mapping : getMappings())
      {
         if (mapping.matches(url))
         {
            if (!mapping.getPatternParser().isElPattern()) {
               cachedMappings.put(mappingKey, mapping);
            }
            return mapping;
         }
      }
      return null;
   }
public UrlMapping getMappingForUrl(final URL url)
   {
      final String mappingKey = url.toURL();
      if (cachedMappings.containsKey(mappingKey)) {
         return cachedMappings.get(mappingKey);
      }
      for (UrlMapping mapping : getMappings())
      {
         if (mapping.matches(url))
         {
            if (!mapping.getPatternParser().isElPattern()) {
               cachedMappings.put(mappingKey, mapping);
            }
            return mapping;
         }
      }
      return null;
   }
Search through all currently configured {@link UrlMapping} objects for the first one that matches the given URL.

@return the first appropriate {@link UrlMapping} for a given URL.