WebContext.getServerPort

This commit is contained in:
shimingxy
2024-11-15 08:55:19 +08:00
parent 176355d7a6
commit 05e089358a
4 changed files with 7 additions and 3 deletions

View File

@@ -150,6 +150,10 @@ public final class WebContext {
public static String getProperty(String key) {
return properties.getProperty(key);
}
public static String getServerPort() {
return getProperty("server.port");
}
// below method is common HttpServlet method
/**

View File

@@ -48,7 +48,7 @@ public class MaxKeyApplication extends SpringBootServletInitializer {
new InitializeContext(applicationContext).init();
_logger.info("MaxKey at {}" , new DateTime());
_logger.info("MaxKey Server Port {}" , WebContext.getProperty("server.port"));
_logger.info("MaxKey Server Port {}" , WebContext.getServerPort());
_logger.info("MaxKey started.");
}

View File

@@ -45,7 +45,7 @@ public class MaxKeyMgtApplication extends SpringBootServletInitializer {
new InitializeContext(applicationContext).init();
_logger.info("MaxKeyMgt at {}" , new DateTime());
_logger.info("MaxKeyMgt Server Port {}" , WebContext.getProperty("server.port"));
_logger.info("MaxKeyMgt Server Port {}" , WebContext.getServerPort());
_logger.info("MaxKeyMgt started.");
}

View File

@@ -46,7 +46,7 @@ public class MaxKeyOpenApiApplication extends SpringBootServletInitializer {
new InitializeContext(applicationContext).init();
_logger.info("MaxKey OpenApi at {}" , new DateTime());
_logger.info("MaxKey OpenApi Server Port {}" , WebContext.getProperty("server.port"));
_logger.info("MaxKey OpenApi Server Port {}" , WebContext.getServerPort());
_logger.info("MaxKey OpenApi started.");
}