diff options
author | Rafael Guterres <guterresrafael@gmail.com> | 2015-11-27 03:45:22 -0200 |
---|---|---|
committer | Rafael Guterres <guterresrafael@gmail.com> | 2015-11-27 03:45:22 -0200 |
commit | ca06e8d38c0bbd5a68e63ebada8e115da252b055 (patch) | |
tree | 39c00c4ceb571cae540d4c25d38ad3d45c72b49c /src/org/traccar/web/WebServer.java | |
parent | c57bd2d472467b1b3a45aee1b97c9a0aeef5958a (diff) | |
parent | 7db2eb1ad224bf00608ebbcfe13bfa7fd519a7fc (diff) | |
download | trackermap-server-ca06e8d38c0bbd5a68e63ebada8e115da252b055.tar.gz trackermap-server-ca06e8d38c0bbd5a68e63ebada8e115da252b055.tar.bz2 trackermap-server-ca06e8d38c0bbd5a68e63ebada8e115da252b055.zip |
Merge tananaev/master
Conflicts:
src/org/traccar/web/WebServer.java
Diffstat (limited to 'src/org/traccar/web/WebServer.java')
-rw-r--r-- | src/org/traccar/web/WebServer.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/org/traccar/web/WebServer.java b/src/org/traccar/web/WebServer.java index 146dee613..0f9bf8181 100644 --- a/src/org/traccar/web/WebServer.java +++ b/src/org/traccar/web/WebServer.java @@ -61,6 +61,9 @@ public class WebServer { break; case "new": initApi(); + if (config.getBoolean("web.console")) { + initConsole(); + } initWebApp(); break; case "old": @@ -118,12 +121,10 @@ public class WebServer { handlers.addHandler(servletHandler); } - private void initRestApi() { - ResourceConfig resourceConfig = new ResourceConfig(); - resourceConfig.packages("org.traccar.api"); - ServletContextHandler servletHandler = new ServletContextHandler(ServletContextHandler.NO_SESSIONS); - ServletHolder servletHolder = new ServletHolder(new ServletContainer(resourceConfig)); - servletHandler.addServlet(servletHolder, "/rest/*"); + private void initConsole() { + ServletContextHandler servletHandler = new ServletContextHandler(ServletContextHandler.SESSIONS); + servletHandler.setContextPath("/console"); + servletHandler.addServlet(new ServletHolder(new ConsoleServlet()), "/*"); handlers.addHandler(servletHandler); } |