aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-01-05 10:35:10 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-01-05 10:35:10 +1300
commit547ba114449a882839498044d1bf9d0592c2174f (patch)
treee76e9e5249a8128087e2eaca778ee69fbb8cc880 /src/org/traccar/web
parent1f1e3f227304bae09596fb511d6210438f394ca4 (diff)
parent2343c85411614b0e16bb8a24eaafd8f33e1cfa71 (diff)
downloadtrackermap-server-547ba114449a882839498044d1bf9d0592c2174f.tar.gz
trackermap-server-547ba114449a882839498044d1bf9d0592c2174f.tar.bz2
trackermap-server-547ba114449a882839498044d1bf9d0592c2174f.zip
Merge pull request #1606 from vitalidze/master
Commands sending integration
Diffstat (limited to 'src/org/traccar/web')
-rw-r--r--src/org/traccar/web/WebServer.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/org/traccar/web/WebServer.java b/src/org/traccar/web/WebServer.java
index 58f4c7f29..85cc5f75c 100644
--- a/src/org/traccar/web/WebServer.java
+++ b/src/org/traccar/web/WebServer.java
@@ -24,9 +24,11 @@ import javax.sql.DataSource;
import org.eclipse.jetty.http.HttpStatus;
import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.SessionManager;
import org.eclipse.jetty.server.handler.ErrorHandler;
import org.eclipse.jetty.server.handler.HandlerList;
import org.eclipse.jetty.server.handler.ResourceHandler;
+import org.eclipse.jetty.server.session.HashSessionManager;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.webapp.WebAppContext;
@@ -53,6 +55,7 @@ public class WebServer {
private final Config config;
private final DataSource dataSource;
private final HandlerList handlers = new HandlerList();
+ private final SessionManager sessionManager = new HashSessionManager();
private void initServer() {
@@ -119,6 +122,7 @@ public class WebServer {
WebAppContext app = new WebAppContext();
app.setContextPath("/");
+ app.getSessionHandler().setSessionManager(sessionManager);
app.setWar(config.getString("web.application"));
handlers.addHandler(app);
}
@@ -126,6 +130,7 @@ public class WebServer {
private void initApi() {
ServletContextHandler servletHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);
servletHandler.setContextPath("/api");
+ servletHandler.getSessionHandler().setSessionManager(sessionManager);
servletHandler.addServlet(new ServletHolder(new AsyncSocketServlet()), "/socket");
@@ -144,6 +149,8 @@ public class WebServer {
private void initOldApi() {
ServletContextHandler servletHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);
servletHandler.setContextPath("/api");
+ servletHandler.getSessionHandler().setSessionManager(sessionManager);
+
servletHandler.addServlet(new ServletHolder(new AsyncServlet()), "/async/*");
servletHandler.addServlet(new ServletHolder(new ServerServlet()), "/server/*");
servletHandler.addServlet(new ServletHolder(new UserServlet()), "/user/*");