//RequestLogHandler logHandler = createRequestLogHandler(site);
//contextPath = site.root
String root = contextPath;//site.getRoot();
if("".equals(root)){
ResourceHandler resource_handler = new ResourceHandler();
// resource_handler.setDirectoriesListed(true);
resource_handler.setWelcomeFiles(new String[] { "index.html" });
// resource_handler.setResourceBase("target/public");
resource_handler.setResourceBase(resourceBase/*site.getDestination().getPath()*/);
String base = resource_handler.getResourceBase();
log.info("Server resource base: " + base);
HandlerList handlers = new HandlerList();
handlers.setHandlers(new Handler[] { resource_handler, new DefaultHandler()});
server.setHandler(handlers);
// server.setHandlers(new Handler[]{handlers, logHandler});
log.info( "Starting preview server on http://localhost:" + port + "/" );
}else{
log.info("Using " + ContextHandler.class.getName());
ContextHandler contextHandler = new ContextHandler();
contextHandler.setContextPath(root);
contextHandler.setHandler(new ResourceHandler());
contextHandler.setResourceBase(resourceBase/*site.getDestination().getPath()*/);
server.setHandler(contextHandler);
// server.setHandlers(new Handler[]{contextHandler, logHandler});
log.info( "Starting preview server on http://localhost:" + port + root );