Connector connector = new SelectChannelConnector();
connector.setPort(port);
server.setConnectors(new Connector[] { connector });
HandlerCollection handlers = new HandlerCollection();
ContextHandlerCollection contexts = new ContextHandlerCollection();
WebAppContext webAppContext = new WebAppContext(contextLocation.getAbsolutePath(), contextPath);
contexts.addHandler(webAppContext);
RequestLogHandler requestLogHandler = new RequestLogHandler();
handlers.setHandlers(new Handler[] { contexts, new DefaultHandler(), requestLogHandler });
server.setHandler(handlers);
server.setStopAtShutdown(true);
server.setSendServerVersion(true);