diff options
-rw-r--r-- | setup/default.xml | 1 | ||||
-rw-r--r-- | src/main/java/org/traccar/web/DefaultOverrideServlet.java (renamed from src/main/java/org/traccar/web/ModernDefaultServlet.java) | 6 | ||||
-rw-r--r-- | src/main/java/org/traccar/web/WebServer.java | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/setup/default.xml b/setup/default.xml index 092b4f494..6be4f105d 100644 --- a/setup/default.xml +++ b/setup/default.xml @@ -12,6 +12,7 @@ <entry key='web.port'>8082</entry> <entry key='web.path'>./web</entry> + <entry key='web.override'>./override</entry> <entry key='web.sanitize'>false</entry> <entry key='web.persistSession'>false</entry> <entry key='web.showUnknownDevices'>true</entry> diff --git a/src/main/java/org/traccar/web/ModernDefaultServlet.java b/src/main/java/org/traccar/web/DefaultOverrideServlet.java index a7c8cdb29..14b441f86 100644 --- a/src/main/java/org/traccar/web/ModernDefaultServlet.java +++ b/src/main/java/org/traccar/web/DefaultOverrideServlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 Anton Tananaev (anton@traccar.org) + * Copyright 2023 - 2024 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,12 +24,12 @@ import jakarta.inject.Inject; import java.io.File; import java.io.IOException; -public class ModernDefaultServlet extends DefaultServlet { +public class DefaultOverrideServlet extends DefaultServlet { private Resource overrideResource; @Inject - public ModernDefaultServlet(Config config) { + public DefaultOverrideServlet(Config config) { String override = config.getString(Keys.WEB_OVERRIDE); if (override != null) { overrideResource = Resource.newResource(new File(override)); diff --git a/src/main/java/org/traccar/web/WebServer.java b/src/main/java/org/traccar/web/WebServer.java index 4759942b1..68fcf52de 100644 --- a/src/main/java/org/traccar/web/WebServer.java +++ b/src/main/java/org/traccar/web/WebServer.java @@ -139,7 +139,7 @@ public class WebServer implements LifecycleObject { } private void initWebApp(ServletContextHandler servletHandler) { - ServletHolder servletHolder = new ServletHolder(new ModernDefaultServlet(config)); + ServletHolder servletHolder = new ServletHolder(new DefaultOverrideServlet(config)); servletHolder.setInitParameter("resourceBase", new File(config.getString(Keys.WEB_PATH)).getAbsolutePath()); servletHolder.setInitParameter("dirAllowed", "false"); if (config.getBoolean(Keys.WEB_DEBUG)) { |