From 684af3de61e98949508652f35a8a5693409813d7 Mon Sep 17 00:00:00 2001 From: Redkale <8730487+redkale@users.noreply.github.com> Date: Thu, 23 Aug 2018 09:59:14 +0800 Subject: [PATCH] =?UTF-8?q?application.xml=E7=9A=84properties=E5=80=BC?= =?UTF-8?q?=E6=94=AF=E6=8C=81${APP=5FHOME}?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/org/redkale/boot/Application.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/org/redkale/boot/Application.java b/src/org/redkale/boot/Application.java index e5116d825..480190b08 100644 --- a/src/org/redkale/boot/Application.java +++ b/src/org/redkale/boot/Application.java @@ -423,7 +423,7 @@ public final class Application { InputStream in = new FileInputStream(df); ps.load(in); in.close(); - ps.forEach((x, y) -> resourceFactory.register("property." + x, y)); + ps.forEach((x, y) -> resourceFactory.register("property." + x, y.toString().replace("${APP_HOME}", homepath))); } } } @@ -431,6 +431,7 @@ public final class Application { String name = prop.getValue("name"); String value = prop.getValue("value"); if (name == null || value == null) continue; + value = value.replace("${APP_HOME}", homepath); if (name.startsWith("system.property.")) { System.setProperty(name.substring("system.property.".length()), value); } else if (name.startsWith("mimetype.property.")) {