From 095e841895a2204547a76a8ae00823d436bc4c80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E9=81=93=E5=9D=A4?= Date: Wed, 24 Jan 2018 14:44:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20AppContext.java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nutzboot-core/src/main/java/org/nutz/boot/AppContext.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nutzboot-core/src/main/java/org/nutz/boot/AppContext.java b/nutzboot-core/src/main/java/org/nutz/boot/AppContext.java index 53b9b476..e9a835d1 100644 --- a/nutzboot-core/src/main/java/org/nutz/boot/AppContext.java +++ b/nutzboot-core/src/main/java/org/nutz/boot/AppContext.java @@ -332,8 +332,12 @@ public class AppContext implements LifeCycle { } public int getServerPort(String legacyKey, int defaultValue) { - if (defaultValue == 8080 && legacyKey != null && getConf().has(legacyKey)) { - log.infof("%s is deprecated, use %s instead", legacyKey, "server.port"); + if (defaultValue == 8080 && legacyKey != null && getConf().has(legacyKey)){ + log.infof("%s is deprecated, use %s instead,the defaultValue is %s", "server.port", legacyKey,"8080"); + return getConf().getInt(legacyKey); + } + if (legacyKey != null && getConf().has(legacyKey)) { + log.infof("%s is deprecated, use %s instead", "server.port", legacyKey); return getConf().getInt(legacyKey); } int port = getConf().getInt("server.port", defaultValue); From c20ca3cd568e6cc818775dd38a68775e5fbdb566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E9=81=93=E5=9D=A4?= Date: Wed, 24 Jan 2018 22:41:05 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20AppContext.java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nutzboot-core/src/main/java/org/nutz/boot/AppContext.java | 1 - 1 file changed, 1 deletion(-) diff --git a/nutzboot-core/src/main/java/org/nutz/boot/AppContext.java b/nutzboot-core/src/main/java/org/nutz/boot/AppContext.java index e9a835d1..b9406d44 100644 --- a/nutzboot-core/src/main/java/org/nutz/boot/AppContext.java +++ b/nutzboot-core/src/main/java/org/nutz/boot/AppContext.java @@ -337,7 +337,6 @@ public class AppContext implements LifeCycle { return getConf().getInt(legacyKey); } if (legacyKey != null && getConf().has(legacyKey)) { - log.infof("%s is deprecated, use %s instead", "server.port", legacyKey); return getConf().getInt(legacyKey); } int port = getConf().getInt("server.port", defaultValue);