if (!location.endsWith("/")) {
location = location + "/";
}
// load the application
WebApplicationContext ctx = server.addWebApplication(appInfo.mountPoint, location);
ctx.setAttribute("_serverId", appInfo.server);
// set the session manager
SessionManager sm = new HashSessionManager();
ctx.getWebApplicationHandler().setSessionManager(sm);
// set the virtual hosts
Iterator vh = virtualHosts.iterator();
while (vh.hasNext()) {
ctx.addVirtualHost((String)vh.next());
}
// set the init parameters
Iterator ip = initParameters.keySet().iterator();
while (ip.hasNext()) {
String paramName = (String) ip.next();
ctx.setInitParameter(paramName, (String) initParameters.get(paramName));
}
} catch (IOException e) {
Debug.logError(e, "Problem mounting application [" + appInfo.name + " / " + appInfo.location + "]", module);
}