public void setElementValue(XMLElement element, String value) {
if (SipTagNames.MAIN_SERVLET.equals(element.getQName())) {
XMLNode node = getParentNode().getParentNode();
if( node instanceof SipBundleNode) {
SipBundleNode sipBundleNode = (SipBundleNode) node;
SipApplication sipApp = (SipApplication) sipBundleNode.getDescriptor();
sipApp.setMainservletName(value);
// create a mapping for this servlet
ExistsOperand existsOperand = new ExistsOperand();
existsOperand.setVariable("request.method");
Pattern pattern = new Pattern();
pattern.addCondition(existsOperand);
ServletMapping servletMapping = new ServletMapping();
servletMapping.setServletName(value);
servletMapping.setPattern(pattern);
sipApp.addServletMapping(servletMapping);
}
}
}