aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-09-30 11:14:57 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2018-09-30 11:14:57 +1300
commit3179094aacede295938f64e21178bbb6f7fa0867 (patch)
treea2379e52116ca689218396292dc7ce44c5c664cb /src/org/traccar/web
parentd78c97e18f7078a3260d3a091145721cffb2a1b0 (diff)
downloadtrackermap-server-3179094aacede295938f64e21178bbb6f7fa0867.tar.gz
trackermap-server-3179094aacede295938f64e21178bbb6f7fa0867.tar.bz2
trackermap-server-3179094aacede295938f64e21178bbb6f7fa0867.zip
Remove support for war app
Diffstat (limited to 'src/org/traccar/web')
-rw-r--r--src/org/traccar/web/WebServer.java32
1 files changed, 3 insertions, 29 deletions
diff --git a/src/org/traccar/web/WebServer.java b/src/org/traccar/web/WebServer.java
index 90ea74a3b..1f56c4139 100644
--- a/src/org/traccar/web/WebServer.java
+++ b/src/org/traccar/web/WebServer.java
@@ -59,7 +59,6 @@ public class WebServer {
private Server server;
private final Config config;
- private final DataSource dataSource;
private final HandlerList handlers = new HandlerList();
private int sessionTimeout;
@@ -74,9 +73,8 @@ public class WebServer {
}
}
- public WebServer(Config config, DataSource dataSource) {
+ public WebServer(Config config) {
this.config = config;
- this.dataSource = dataSource;
sessionTimeout = config.getInteger("web.sessionTimeout");
initServer();
@@ -84,14 +82,7 @@ public class WebServer {
if (config.getBoolean("web.console")) {
initConsole();
}
- switch (config.getString("web.type", "new")) {
- case "old":
- initOldWebApp();
- break;
- default:
- initWebApp();
- break;
- }
+ initWebApp();
initClientProxy();
server.setHandler(handlers);
@@ -129,7 +120,7 @@ public class WebServer {
ResourceHandler resourceHandler = new ResourceHandler();
resourceHandler.setResourceBase(config.getString("web.path"));
if (config.getBoolean("web.debug")) {
- resourceHandler.setWelcomeFiles(new String[] {"debug.html", "index.html"});
+ resourceHandler.setWelcomeFiles(new String[] {"release.html", "index.html"});
} else {
String cache = config.getString("web.cacheControl");
if (cache != null && !cache.isEmpty()) {
@@ -140,23 +131,6 @@ public class WebServer {
handlers.addHandler(resourceHandler);
}
- private void initOldWebApp() {
- try {
- javax.naming.Context context = new InitialContext();
- context.bind("java:/DefaultDS", dataSource);
- } catch (Exception error) {
- LOGGER.warn("JNDI context error", error);
- }
-
- WebAppContext app = new WebAppContext();
- app.setContextPath("/");
- if (sessionTimeout > 0) {
- app.getSessionHandler().setMaxInactiveInterval(sessionTimeout);
- }
- app.setWar(config.getString("web.application"));
- handlers.addHandler(app);
- }
-
private void initApi() {
ServletContextHandler servletHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);
servletHandler.setContextPath("/api");