for (Class<?> cls : classes) {
if (!Filter.class.isAssignableFrom(cls)) {
throw new DeploymentException("The class " + cls.getName() + " with WebFilter annotation must implement javax.servlet.Filter");
}
WebFilter webFilter = cls.getAnnotation(WebFilter.class);
String filterName = webFilter.filterName().length() == 0 ? cls.getName() : webFilter.filterName();
boolean valueAttributeConfigured = webFilter.value().length > 0;
boolean urlPatternsAttributeConfigured = webFilter.urlPatterns().length > 0;
if (valueAttributeConfigured && urlPatternsAttributeConfigured) {
throw new DeploymentException("value and urlPatterns must not be configured on the same WebFilter annotation in the class " + cls.getName());
}