//FIXME To my understanding of the spec, once there are url-patterns configured in the descriptors, those configurations from the annotations are ignored
ServletMappingType newServletMapping = webApp.addNewServletMapping();
//create servlet-mapping element
newServletMapping.addNewServletName().setStringValue(servletName);
for (String urlPattern : urlPatterns) {
newServletMapping.addNewUrlPattern().setStringValue(urlPattern);
}
ServletMappingMergeHandler.addServletMapping(newServletMapping, mergeContext);
//Set this tag, so that if any following web-fragment.xml has defined the url-patterns explicitly, it could drop the configurations from annotation
mergeContext.setAttribute(ServletMappingMergeHandler.createServletMappingSourceKey(servletName), ElementSource.ANNOTATION);
}