webServer.addListener(listener);
// set up the context for "/logs/" if "hadoop.log.dir" property is defined.
String logDir = System.getProperty("hadoop.log.dir");
if (logDir != null) {
HttpContext logContext = new HttpContext();
logContext.setContextPath("/logs/*");
logContext.setResourceBase(logDir);
logContext.addHandler(new ResourceHandler());
webServer.addContext(logContext);
}
// set up the context for "/static/*"
String appDir = getWebAppsPath();
HttpContext staticContext = new HttpContext();
staticContext.setContextPath("/static/*");
staticContext.setResourceBase(appDir + "/static");
staticContext.addHandler(new ResourceHandler());
webServer.addContext(staticContext);
// set up the context for "/" jsp files
webAppContext =
webServer.addWebApplication("/", appDir + File.separator + name);