aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/api/SecurityRequestFilter.java1
-rw-r--r--src/org/traccar/web/WebServer.java34
2 files changed, 12 insertions, 23 deletions
diff --git a/src/org/traccar/api/SecurityRequestFilter.java b/src/org/traccar/api/SecurityRequestFilter.java
index d4f685000..5f4d2332f 100644
--- a/src/org/traccar/api/SecurityRequestFilter.java
+++ b/src/org/traccar/api/SecurityRequestFilter.java
@@ -20,7 +20,6 @@ import org.traccar.api.resource.SessionResource;
import org.traccar.model.User;
import java.nio.charset.Charset;
-import java.security.Security;
import java.sql.SQLException;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.Path;
diff --git a/src/org/traccar/web/WebServer.java b/src/org/traccar/web/WebServer.java
index ad40e246f..82a695e96 100644
--- a/src/org/traccar/web/WebServer.java
+++ b/src/org/traccar/web/WebServer.java
@@ -35,9 +35,6 @@ import org.traccar.api.resource.SessionResource;
import org.traccar.api.resource.UserResource;
import org.traccar.helper.Log;
-/**
- * Integrated HTTP server
- */
public class WebServer {
private Server server;
@@ -63,21 +60,19 @@ public class WebServer {
initServer();
switch (config.getString("web.type", "new")) {
case "api":
- initApi();
- break;
- case "new":
- initApi();
- if (config.getBoolean("web.console")) {
- initConsole();
- }
- initWebApp();
+ initOldApi();
break;
case "old":
- initApi();
+ initOldApi();
+ initRestApi();
initOldWebApp();
break;
default:
- Log.error("Unsupported web application type: " + config.getString("web.type"));
+ initRestApi();
+ if (config.getBoolean("web.console")) {
+ initConsole();
+ }
+ initWebApp();
break;
}
server.setHandler(handlers);
@@ -102,15 +97,10 @@ public class WebServer {
Log.warning(error);
}
- WebAppContext webapp = new WebAppContext();
- webapp.setContextPath("/");
- webapp.setWar(config.getString("web.application"));
- handlers.addHandler(webapp);
- }
-
- private void initApi() {
- initOldApi();
- initRestApi();
+ WebAppContext app = new WebAppContext();
+ app.setContextPath("/");
+ app.setWar(config.getString("web.application"));
+ handlers.addHandler(app);
}
@Deprecated