@SuppressWarnings("unchecked") protected ContextHandler createContext(String filename) throws Exception {
  Resource resource=Resource.newResource(filename);
  if (!resource.exists()) {
    return null;
  }
  XmlConfiguration xmlConfiguration=new XmlConfiguration(resource.getURL());
  HashMap properties=new HashMap();
  properties.put("Server",_contexts.getServer());
  if (_configMgr != null) {
    properties.putAll(_configMgr.getProperties());
  }
  xmlConfiguration.setProperties(properties);
  ContextHandler context=(ContextHandler)xmlConfiguration.configure();
  Enumeration<?> names=_attributes.getAttributeNames();
  while (names.hasMoreElements()) {
    String name=(String)names.nextElement();
    context.setAttribute(name,_attributes.getAttribute(name));
  }
  return context;
}

@ SuppressWarnings ( "unchecked" ) protected ContextHandler createContext ( String filename ) throws Exception { Resource resource = Resource . newResource ( filename ) ; if ( ! resource . exists ( ) ) { return null ; } XmlConfiguration xmlConfiguration = new XmlConfiguration ( resource . getURL ( ) ) ; HashMap properties = new HashMap ( ) ; properties . put ( "Server" , _contexts . getServer ( ) ) ; if ( _configMgr != null ) { properties . putAll ( _configMgr . getProperties ( ) ) ; } xmlConfiguration . setProperties ( properties ) ; ContextHandler context = ( ContextHandler ) xmlConfiguration . configure ( ) ; Enumeration < ? > names = _attributes . getAttributeNames ( ) ; while ( names . hasMoreElements ( ) ) { String name = ( String ) names . nextElement ( ) ; context . setAttribute ( name , _attributes . getAttribute ( name ) ) ; } return context ; }
create a webappcontext for the webapp being hot deployed , then apply the xml config file to it to configure it .
