ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
context.setContextPath("/zpgamereconcile");
context.addServlet(LoginController.class, "/login");
context.addServlet(HomeController.class, "/home");
context.addServlet(AdminController.class, "/admin/*");
context.addServlet(ParseLogController.class, "/parselog/*");
context.addServlet(ReconcileController.class, "/reconcile/*");
SessionHandler sessionHandler = context.getSessionHandler();
HashSessionManager sessionManager = (HashSessionManager) sessionHandler.getSessionManager();
sessionManager.setStoreDirectory(new File("/tmp/" + WebServer.class.getName()));
sessionManager.setSavePeriod(1);
// static resource
ResourceHandler resourceHandler = new ResourceHandler();
resourceHandler.setDirectoriesListed(true);
resourceHandler.setResourceBase(".");
ContextHandler ctx = new ContextHandler("/zpgamereconcile"); /* the server uri path */
ctx.setHandler(resourceHandler);
HandlerList handlers = new HandlerList();
handlers.setHandlers(new Handler[]{
ctx, context//handler,
});
//TODO: maxFormContentSize
server.setAttribute("org.eclipse.jetty.server.Request.maxFormContentSize", -1);
server.setHandler(handlers);