diff options
author | Abyss777 <abyss@fox5.ru> | 2016-12-10 13:09:45 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-12-10 13:09:45 +0500 |
commit | 50ca72b3249bece77434a8d5151577dcd8867697 (patch) | |
tree | 889fc63b04191a5e0af129c14c09579fb761b1e9 /src | |
parent | 17dc43290bb821c77eaaf196e4c6fef4d5c1a343 (diff) | |
download | trackermap-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')
-rw-r--r-- | src/org/traccar/Context.java | 5 |
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); |