aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-12-10 13:09:45 +0500
committerAbyss777 <abyss@fox5.ru>2016-12-10 13:09:45 +0500
commit50ca72b3249bece77434a8d5151577dcd8867697 (patch)
tree889fc63b04191a5e0af129c14c09579fb761b1e9 /src/org
parent17dc43290bb821c77eaaf196e4c6fef4d5c1a343 (diff)
downloadtrackermap-server-50ca72b3249bece77434a8d5151577dcd8867697.tar.gz
trackermap-server-50ca72b3249bece77434a8d5151577dcd8867697.tar.bz2
trackermap-server-50ca72b3249bece77434a8d5151577dcd8867697.zip
- Use URL builder
- Use Curly braces in templates
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/Context.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java
index 62396d740..2cd1beecc 100644
--- a/src/org/traccar/Context.java
+++ b/src/org/traccar/Context.java
@@ -21,6 +21,7 @@ import java.net.InetAddress;
import java.util.Properties;
import org.apache.velocity.app.VelocityEngine;
+import org.eclipse.jetty.util.URIUtil;
import org.traccar.database.AliasesManager;
import org.traccar.database.ConnectionManager;
import org.traccar.database.DataManager;
@@ -259,8 +260,8 @@ public final class Context {
"org.apache.velocity.runtime.log.NullLogChute");
String address = config.getString("web.address", InetAddress.getLocalHost().getHostAddress());
- String port = config.getString("web.port", "8082");
- String webUrl = "http://" + address + ":" + port + "/";
+ int port = config.getInteger("web.port", 8082);
+ String webUrl = URIUtil.newURI("http", address, port, "", "");
webUrl = Context.getConfig().getString("web.url", webUrl);
velocityProperties.setProperty("web.url", webUrl);