receives notiification of the value for a particular tag
if (WebTagNames.SERVLET_NAME.equals(element.getQName())) {
servletName = value;
}
if (WebTagNames.URL_PATTERN.equals(element.getQName())) {
// If URL Pattern does not start with "/" then
// prepend it (for Servlet2.2 Web apps)
Object parent = getParentNode().getDescriptor();
if (parent instanceof WebBundleDescriptor &&
((WebBundleDescriptor) parent).getSpecVersion().equals("2.2"))
{
if(!value.startsWith("/") && !value.startsWith("*.")) {
value = "/" + value;
}
}
urlPattern = value;
if (!URLPattern.isValid(urlPattern)) {
throw new IllegalArgumentException(localStrings.getLocalString(
"enterprise.deployment.invalidurlpattern",
"Invalid URL Pattern: [{0}]",
new Object[] {urlPattern}));
}
XMLNode parentNode = getParentNode();
if (parentNode instanceof WebBundleNode) {
((WebBundleNode) parentNode).addServletMapping(servletName,
urlPattern);
} else {
DOLUtils.getDefaultLogger().log(Level.SEVERE, "enterprise.deployment.backend.addDescriptorFailure",
new Object[]{getXMLRootTag() , "servlet-mapping"});
}
}