}
private void hasValidMapping(WebBundleDescriptor descriptor, String filterName) {
Enumeration filtermapperEnum = descriptor.getServletFilterMappingDescriptors().elements();
if (filtermapperEnum.hasMoreElements()) {
ServletFilterMappingDescriptor filterMapper = null;
boolean mappingFound = false;
do {
filterMapper = (ServletFilterMappingDescriptor)filtermapperEnum.nextElement();
String filterMapping = filterMapper.getName();
mappingFound = filterName.equals(filterMapping);
} while (!mappingFound && filtermapperEnum.hasMoreElements());
if (mappingFound) {
List<String> urlPatterns = filterMapper.getURLPatterns();
for(String url : urlPatterns) {
if (!((url.startsWith("/")) ||
((url.startsWith("/")) && (url.endsWith("/*"))) ||
(url.startsWith("*.")))) {
addErrorDetails(result, compName);
result.failed(smh.getLocalString
(getClass().getName() + ".failed",
"Filter Mapping for [ {0} ] has invalid " +
"url-mapping [ {1} ] ",
new Object[] {filterName, url} ));
}
}
List<String> servletsInFilter = filterMapper.getServletNames();
// Section SRV.18.0.2 Filter All Dispatches of Servlet 2.5 spec allows "*"
// to be specified as Servlet name to allow filtering of requests for all servlets.
final String ALL_SERVLETS_NAME = "*";
servletsInFilter.remove(ALL_SERVLETS_NAME);
List<String> servletsInWAR = new ArrayList<String>();