listener = new SocketListener();
listener.setPort(port);
webServer.addListener(listener);
// set up the context for "/logs/"
HttpContext logContext = new HttpContext();
logContext.setContextPath("/logs/*");
String logDir = System.getProperty("hadoop.log.dir");
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 + File.separator + "static");
staticContext.addHandler(new ResourceHandler());
webServer.addContext(staticContext);
// set up the context for "/" jsp files
webAppContext =
webServer.addWebApplication("/", appDir + File.separator + name);