/** * Gets the filter mappings. * * @param fmap the fmap * @param dm the dm * @param filterClass the filter class * @return the filter mappings */ protected List<FilterMapping> getFilterMappings(FilterMap fmap, String dm, String filterClass) { String[] urls = fmap.getURLPatterns(); String[] servlets = fmap.getServletNames(); List<FilterMapping> results = new ArrayList<>(urls.length + servlets.length); addFilterMapping(fmap.getFilterName(), dm, filterClass, urls, results, FilterMapType.URL); addFilterMapping(fmap.getFilterName(), dm, filterClass, servlets, results, FilterMapType.SERVLET_NAME); return results; }
@Override public Collection<String> getUrlPatternMappings() { Collection<String> result = new HashSet<String>(); FilterMap[] filterMaps = context.findFilterMaps(); for (FilterMap filterMap : filterMaps) { if (filterMap.getFilterName().equals(filterDef.getFilterName())) { for (String urlPattern : filterMap.getURLPatterns()) { result.add(urlPattern); } } } return result; }
@Override public Collection<String> getUrlPatternMappings() { Collection<String> result = new HashSet<String>(); FilterMap[] filterMaps = context.findFilterMaps(); for (FilterMap filterMap : filterMaps) { if (filterMap.getFilterName().equals(filterDef.getFilterName())) { for (String urlPattern : filterMap.getURLPatterns()) { result.add(urlPattern); } } } return result; }
@Override public Collection<String> getUrlPatternMappings() { Collection<String> result = new HashSet<String>(); FilterMap[] filterMaps = context.findFilterMaps(); for (FilterMap filterMap : filterMaps) { if (filterMap.getFilterName().equals(filterDef.getFilterName())) { for (String urlPattern : filterMap.getURLPatterns()) { result.add(urlPattern); } } } return result; }
@Override public Collection<String> getUrlPatternMappings() { Collection<String> result = new HashSet<String>(); FilterMap[] filterMaps = context.findFilterMaps(); for (FilterMap filterMap : filterMaps) { if (filterMap.getFilterName().equals(filterDef.getFilterName())) { for (String urlPattern : filterMap.getURLPatterns()) { result.add(urlPattern); } } } return result; }
@Override public Collection<String> getUrlPatternMappings() { Collection<String> result = new HashSet<String>(); FilterMap[] filterMaps = context.findFilterMaps(); for (FilterMap filterMap : filterMaps) { if (filterMap.getFilterName().equals(filterDef.getFilterName())) { for (String urlPattern : filterMap.getURLPatterns()) { result.add(urlPattern); } } } return result; }
public Collection<String> getUrlPatternMappings() { HashSet<String> result = new HashSet<String>(); FilterMap[] filterMaps = context.findFilterMaps(); for (int i = 0; i < filterMaps.length; i++) { if (filterDef.getFilterName().equals(filterMaps[i].getFilterName())) { FilterMap filterMap = filterMaps[i]; String[] maps = filterMap.getURLPatterns(); for (int j = 0; j < maps.length; j++) { result.add(maps[j]); } if (filterMap.getMatchAllUrlPatterns()) { result.add("*"); } } } return Collections.unmodifiableSet(result); }
public Collection<String> getUrlPatternMappings() { HashSet<String> result = new HashSet<String>(); FilterMap[] filterMaps = context.findFilterMaps(); for (int i = 0; i < filterMaps.length; i++) { if (filterDef.getFilterName().equals(filterMaps[i].getFilterName())) { FilterMap filterMap = filterMaps[i]; String[] maps = filterMap.getURLPatterns(); for (int j = 0; j < maps.length; j++) { result.add(maps[j]); } if (filterMap.getMatchAllUrlPatterns()) { result.add("*"); } } } return Collections.unmodifiableSet(result); }
/** * Return <code>true</code> if the context-relative request path * matches the requirements of the specified filter mapping; * otherwise, return <code>false</code>. * * @param filterMap Filter mapping being checked * @param requestPath Context-relative request path of this request */ private boolean matchFiltersURL(FilterMap filterMap, String requestPath) { // Check the specific "*" special URL pattern, which also matches // named dispatches if (filterMap.getMatchAllUrlPatterns()) return (true); if (requestPath == null) return (false); // Match on context relative request path String[] testPaths = filterMap.getURLPatterns(); for (int i = 0; i < testPaths.length; i++) { if (matchFiltersURL(testPaths[i], requestPath)) { return (true); } } // No match return (false); }
/** * Return <code>true</code> if the context-relative request path * matches the requirements of the specified filter mapping; * otherwise, return <code>false</code>. * * @param filterMap Filter mapping being checked * @param requestPath Context-relative request path of this request */ private boolean matchFiltersURL(FilterMap filterMap, String requestPath) { // Check the specific "*" special URL pattern, which also matches // named dispatches if (filterMap.getMatchAllUrlPatterns()) return (true); if (requestPath == null) return (false); // Match on context relative request path String[] testPaths = filterMap.getURLPatterns(); for (int i = 0; i < testPaths.length; i++) { if (matchFiltersURL(testPaths[i], requestPath)) { return (true); } } // No match return (false); }
/** * Return <code>true</code> if the context-relative request path * matches the requirements of the specified filter mapping; * otherwise, return <code>false</code>. * * @param filterMap Filter mapping being checked * @param requestPath Context-relative request path of this request */ private boolean matchFiltersURL(FilterMap filterMap, String requestPath) { // Check the specific "*" special URL pattern, which also matches // named dispatches if (filterMap.getMatchAllUrlPatterns()) return (true); if (requestPath == null) return (false); // Match on context relative request path String[] testPaths = filterMap.getURLPatterns(); for (int i = 0; i < testPaths.length; i++) { if (matchFiltersURL(testPaths[i], requestPath)) { return (true); } } // No match return (false); }
/** * Return <code>true</code> if the context-relative request path * matches the requirements of the specified filter mapping; * otherwise, return <code>false</code>. * * @param filterMap Filter mapping being checked * @param requestPath Context-relative request path of this request */ private boolean matchFiltersURL(FilterMap filterMap, String requestPath) { // Check the specific "*" special URL pattern, which also matches // named dispatches if (filterMap.getMatchAllUrlPatterns()) return (true); if (requestPath == null) return (false); // Match on context relative request path String[] testPaths = filterMap.getURLPatterns(); for (int i = 0; i < testPaths.length; i++) { if (matchFiltersURL(testPaths[i], requestPath)) { return (true); } } // No match return (false); }
/** * Return <code>true</code> if the context-relative request path * matches the requirements of the specified filter mapping; * otherwise, return <code>false</code>. * * @param filterMap Filter mapping being checked * @param requestPath Context-relative request path of this request */ private boolean matchFiltersURL(FilterMap filterMap, String requestPath) { // Check the specific "*" special URL pattern, which also matches // named dispatches if (filterMap.getMatchAllUrlPatterns()) return (true); if (requestPath == null) return (false); // Match on context relative request path String[] testPaths = filterMap.getURLPatterns(); for (int i = 0; i < testPaths.length; i++) { if (matchFiltersURL(testPaths[i], requestPath)) { return (true); } } // No match return (false); }
/** * Return <code>true</code> if the context-relative request path * matches the requirements of the specified filter mapping; * otherwise, return <code>false</code>. * * @param filterMap Filter mapping being checked * @param requestPath Context-relative request path of this request */ private boolean matchFiltersURL(FilterMap filterMap, String requestPath) { // Check the specific "*" special URL pattern, which also matches // named dispatches if (filterMap.getMatchAllUrlPatterns()) return (true); if (requestPath == null) return (false); // Match on context relative request path String[] testPaths = filterMap.getURLPatterns(); for (int i = 0; i < testPaths.length; i++) { if (matchFiltersURL(testPaths[i], requestPath)) { return (true); } } // No match return (false); }
/** * Return <code>true</code> if the context-relative request path * matches the requirements of the specified filter mapping; * otherwise, return <code>false</code>. * * @param filterMap Filter mapping being checked * @param requestPath Context-relative request path of this request */ private boolean matchFiltersURL(FilterMap filterMap, String requestPath) { // Check the specific "*" special URL pattern, which also matches // named dispatches if (filterMap.getMatchAllUrlPatterns()) return (true); if (requestPath == null) return (false); // Match on context relative request path String[] testPaths = filterMap.getURLPatterns(); for (int i = 0; i < testPaths.length; i++) { if (matchFiltersURL(testPaths[i], requestPath)) { return (true); } } // No match return (false); }
/** * Validate the supplied FilterMap. */ private void validateFilterMap(FilterMap filterMap) { // Validate the proposed filter mapping String filterName = filterMap.getFilterName(); String[] servletNames = filterMap.getServletNames(); String[] urlPatterns = filterMap.getURLPatterns(); if (findFilterDef(filterName) == null) throw new IllegalArgumentException (sm.getString("standardContext.filterMap.name", filterName)); if (!filterMap.getMatchAllServletNames() && !filterMap.getMatchAllUrlPatterns() && (servletNames.length == 0) && (urlPatterns.length == 0)) throw new IllegalArgumentException (sm.getString("standardContext.filterMap.either")); // FIXME: Older spec revisions may still check this /* if ((servletNames.length != 0) && (urlPatterns.length != 0)) throw new IllegalArgumentException (sm.getString("standardContext.filterMap.either")); */ for (int i = 0; i < urlPatterns.length; i++) { if (!validateURLPattern(urlPatterns[i])) { throw new IllegalArgumentException (sm.getString("standardContext.filterMap.pattern", urlPatterns[i])); } } }
/** * Validate the supplied FilterMap. */ private void validateFilterMap(FilterMap filterMap) { // Validate the proposed filter mapping String filterName = filterMap.getFilterName(); String[] servletNames = filterMap.getServletNames(); String[] urlPatterns = filterMap.getURLPatterns(); if (findFilterDef(filterName) == null) throw new IllegalArgumentException (sm.getString("standardContext.filterMap.name", filterName)); if (!filterMap.getMatchAllServletNames() && !filterMap.getMatchAllUrlPatterns() && (servletNames.length == 0) && (urlPatterns.length == 0)) throw new IllegalArgumentException (sm.getString("standardContext.filterMap.either")); // FIXME: Older spec revisions may still check this /* if ((servletNames.length != 0) && (urlPatterns.length != 0)) throw new IllegalArgumentException (sm.getString("standardContext.filterMap.either")); */ for (int i = 0; i < urlPatterns.length; i++) { if (!validateURLPattern(urlPatterns[i])) { throw new IllegalArgumentException (sm.getString("standardContext.filterMap.pattern", urlPatterns[i])); } } }
/** * Validate the supplied FilterMap. */ private void validateFilterMap(FilterMap filterMap) { // Validate the proposed filter mapping String filterName = filterMap.getFilterName(); String[] servletNames = filterMap.getServletNames(); String[] urlPatterns = filterMap.getURLPatterns(); if (findFilterDef(filterName) == null) throw new IllegalArgumentException (sm.getString("standardContext.filterMap.name", filterName)); if (!filterMap.getMatchAllServletNames() && !filterMap.getMatchAllUrlPatterns() && (servletNames.length == 0) && (urlPatterns.length == 0)) throw new IllegalArgumentException (sm.getString("standardContext.filterMap.either")); // FIXME: Older spec revisions may still check this /* if ((servletNames.length != 0) && (urlPatterns.length != 0)) throw new IllegalArgumentException (sm.getString("standardContext.filterMap.either")); */ for (int i = 0; i < urlPatterns.length; i++) { if (!validateURLPattern(urlPatterns[i])) { throw new IllegalArgumentException (sm.getString("standardContext.filterMap.pattern", urlPatterns[i])); } } }
/** * Validate the supplied FilterMap. */ protected void validateFilterMap(FilterMap filterMap) { // Validate the proposed filter mapping String filterName = filterMap.getFilterName(); String[] servletNames = filterMap.getServletNames(); String[] urlPatterns = filterMap.getURLPatterns(); if (findFilterDef(filterName) == null) throw new IllegalArgumentException (sm.getString("standardContext.filterMap.name", filterName)); if (!filterMap.getMatchAllServletNames() && !filterMap.getMatchAllUrlPatterns() && (servletNames.length == 0) && (urlPatterns.length == 0)) throw new IllegalArgumentException (sm.getString("standardContext.filterMap.either")); // FIXME: Older spec revisions may still check this /* if ((servletNames.length != 0) && (urlPatterns.length != 0)) throw new IllegalArgumentException (sm.getString("standardContext.filterMap.either")); */ for (int i = 0; i < urlPatterns.length; i++) { if (!validateURLPattern(urlPatterns[i])) { throw new IllegalArgumentException (sm.getString("standardContext.filterMap.pattern", urlPatterns[i])); } } }
/** * Validate the supplied FilterMap. */ protected void validateFilterMap(FilterMap filterMap) { // Validate the proposed filter mapping String filterName = filterMap.getFilterName(); String[] servletNames = filterMap.getServletNames(); String[] urlPatterns = filterMap.getURLPatterns(); if (findFilterDef(filterName) == null) throw MESSAGES.unknownFilterNameInMapping(filterName); if (!filterMap.getMatchAllServletNames() && !filterMap.getMatchAllUrlPatterns() && (servletNames.length == 0) && (urlPatterns.length == 0)) throw MESSAGES.missingFilterMapping(); // FIXME: Older spec revisions may still check this /* if ((servletNames.length != 0) && (urlPatterns.length != 0)) throw new IllegalArgumentException (sm.getString("standardContext.filterMap.either")); */ for (int i = 0; i < urlPatterns.length; i++) { if (!validateURLPattern(urlPatterns[i])) { throw MESSAGES.invalidFilterMappingUrlPattern(urlPatterns[i]); } } }