diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-27 15:12:28 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-27 15:12:28 +1300 |
commit | 7db2eb1ad224bf00608ebbcfe13bfa7fd519a7fc (patch) | |
tree | 60840d3b8b39c07802e8c65fee10e8222f992435 /src/org/traccar/web/WebServer.java | |
parent | 6eab101b0070cf5af8fd9e177a2a3ba40e5e836c (diff) | |
download | trackermap-server-7db2eb1ad224bf00608ebbcfe13bfa7fd519a7fc.tar.gz trackermap-server-7db2eb1ad224bf00608ebbcfe13bfa7fd519a7fc.tar.bz2 trackermap-server-7db2eb1ad224bf00608ebbcfe13bfa7fd519a7fc.zip |
Host database console using Jetty
Diffstat (limited to 'src/org/traccar/web/WebServer.java')
-rw-r--r-- | src/org/traccar/web/WebServer.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/org/traccar/web/WebServer.java b/src/org/traccar/web/WebServer.java index 36c43736d..f5a6acdd9 100644 --- a/src/org/traccar/web/WebServer.java +++ b/src/org/traccar/web/WebServer.java @@ -59,6 +59,9 @@ public class WebServer { break; case "new": initApi(); + if (config.getBoolean("web.console")) { + initConsole(); + } initWebApp(); break; case "old": @@ -110,6 +113,13 @@ public class WebServer { handlers.addHandler(servletHandler); } + private void initConsole() { + ServletContextHandler servletHandler = new ServletContextHandler(ServletContextHandler.SESSIONS); + servletHandler.setContextPath("/console"); + servletHandler.addServlet(new ServletHolder(new ConsoleServlet()), "/*"); + handlers.addHandler(servletHandler); + } + public void start() { try { server.start(); |