aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web/WebServer.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-12-02 11:07:11 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-12-02 11:07:11 +1300
commit831a7b81004c0456c317ef4c521cbebd4cbf5fc2 (patch)
tree28c4d7a4ccb95f7b5fb9d947505b6ed717505583 /src/org/traccar/web/WebServer.java
parenteadf492fe75fcfb0da617c9bc66bddd03139c96e (diff)
downloadtrackermap-server-831a7b81004c0456c317ef4c521cbebd4cbf5fc2.tar.gz
trackermap-server-831a7b81004c0456c317ef4c521cbebd4cbf5fc2.tar.bz2
trackermap-server-831a7b81004c0456c317ef4c521cbebd4cbf5fc2.zip
Start web app migration to REST API
Diffstat (limited to 'src/org/traccar/web/WebServer.java')
-rw-r--r--src/org/traccar/web/WebServer.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/org/traccar/web/WebServer.java b/src/org/traccar/web/WebServer.java
index 82a695e96..85be02e4a 100644
--- a/src/org/traccar/web/WebServer.java
+++ b/src/org/traccar/web/WebServer.java
@@ -64,10 +64,10 @@ public class WebServer {
break;
case "old":
initOldApi();
- initRestApi();
initOldWebApp();
break;
default:
+ initOldApi();
initRestApi();
if (config.getBoolean("web.console")) {
initConsole();
@@ -130,9 +130,10 @@ public class WebServer {
resourceConfig.register(CorsResponseFilter.class);
resourceConfig.registerClasses(
ServerResource.class, SessionResource.class, DeviceResource.class, UserResource.class);
+
ServletContextHandler servletHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);
- ServletHolder servletHolder = new ServletHolder(new ServletContainer(resourceConfig));
- servletHandler.addServlet(servletHolder, "/rest/*");
+ servletHandler.setContextPath("/rest");
+ servletHandler.addServlet(new ServletHolder(new ServletContainer(resourceConfig)), "/*");
handlers.addHandler(servletHandler);
}