1 26 27 package org.objectweb.jonas_web.deployment.xml; 28 29 import org.objectweb.jonas_lib.deployment.xml.AbsElement; 30 31 35 public class ServletMapping extends AbsElement { 36 37 40 private String servletName = null; 41 42 45 private String urlPattern = null; 46 47 48 50 51 55 public void setServletName(String servletName) { 56 this.servletName = servletName; 57 } 58 59 60 64 public void setUrlPattern(String urlPattern) { 65 this.urlPattern = urlPattern; 66 } 67 68 69 70 72 75 public String getServletName() { 76 return servletName; 77 } 78 79 82 public String getUrlPattern() { 83 return urlPattern; 84 } 85 86 87 92 public String toXML(int indent) { 93 StringBuffer sb = new StringBuffer (); 94 sb.append(indent(indent)); 95 sb.append("<servlet-mapping>\n"); 96 97 indent += 2; 98 99 sb.append(xmlElement(servletName, "servlet-name", indent)); 101 102 sb.append(xmlElement(urlPattern, "url-pattern", indent)); 104 105 106 indent -= 2; 107 sb.append(indent(indent)); 108 sb.append("</servlet-mapping>\n"); 109 110 return sb.toString(); 111 } 112 113 } 114 | Popular Tags |