// servlet*
Set servlets = webBundleDesc.getWebComponentDescriptorsSet();
if (servlets!=null && !servlets.isEmpty()) {
ServletNode servletNode = new ServletNode();
for (Iterator e= servlets.iterator();e.hasNext();) {
WebComponentDescriptor aServlet = (WebComponentDescriptor) e.next();
servletNode.writeDescriptor(jarNode, aServlet);
}
}
// servlet-mapping*
if (servlets!=null && !servlets.isEmpty()) {
for (Iterator servletsIterator = servlets.iterator(); servletsIterator.hasNext();) {
WebComponentDescriptor aServlet = (WebComponentDescriptor) servletsIterator.next();
for (Iterator patterns = aServlet.getUrlPatternsSet().iterator();patterns.hasNext();) {
String pattern = (String) patterns.next();
Node mappingNode= appendChild(jarNode, WebTagNames.SERVLET_MAPPING);
appendTextChild(mappingNode, WebTagNames.SERVLET_NAME, aServlet.getCanonicalName());
// If URL Pattern does not start with "/" then
// prepend it (for 1.2 Web apps)
if (webBundleDesc.getSpecVersion().equals("2.2")) {
if (!pattern.startsWith("/")