!3 第三方非8080端口服务,无法正确获取端口

Merge pull request !3 from 黄道坤/dev
This commit is contained in:
Wendal 2018-01-24 22:45:58 +08:00
commit e01f2cf9fd

View File

@ -332,8 +332,11 @@ 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)) {
return getConf().getInt(legacyKey);
}
int port = getConf().getInt("server.port", defaultValue);