protected List getFilterMappings(FilterMap fmap, String dm, String filterClass) {
String[] urls = fmap.getURLPatterns();
String[] servlets = fmap.getServletNames();
List filterMappings = new ArrayList(urls.length + servlets.length);
for (int i = 0; i < urls.length; i++) {
FilterMapping fm = new FilterMapping();
fm.setUrl(urls[i]);
fm.setFilterName(fmap.getFilterName());
fm.setDispatcherMap(dm);
fm.setFilterClass(filterClass);
filterMappings.add(fm);
}
for (int i = 0; i < servlets.length; i++) {
FilterMapping fm = new FilterMapping();
fm.setServletName(servlets[i]);
fm.setFilterName(fmap.getFilterName());
fm.setDispatcherMap(dm);
fm.setFilterClass(filterClass);
filterMappings.add(fm);
}
return filterMappings;
}