md
This commit is contained in:
parent
d662666e66
commit
a3c05dbb77
@ -47,7 +47,6 @@ public class LaunchApplication extends SpringBootServletInitializer {
|
|||||||
System.out.println("use config file:" + configFile);
|
System.out.println("use config file:" + configFile);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
ConfigurableApplicationContext context =
|
ConfigurableApplicationContext context =
|
||||||
@ -56,14 +55,9 @@ public class LaunchApplication extends SpringBootServletInitializer {
|
|||||||
.properties("spring.config.location=" + configFile)
|
.properties("spring.config.location=" + configFile)
|
||||||
.web(WebApplicationType.SERVLET).run(args);
|
.web(WebApplicationType.SERVLET).run(args);
|
||||||
|
|
||||||
// 获取Environment实例
|
|
||||||
Environment env = context.getEnvironment();
|
Environment env = context.getEnvironment();
|
||||||
|
|
||||||
// 获取端口号和上下文路径
|
|
||||||
String serverPort = env.getProperty("server.port");
|
String serverPort = env.getProperty("server.port");
|
||||||
String contextPath = env.getProperty("server.servlet.context-path", "");
|
String contextPath = env.getProperty("server.servlet.context-path", "");
|
||||||
|
|
||||||
// 打印启动信息
|
|
||||||
System.out.println("\n\n==>系统启动成功!server.port=" + serverPort + " context-path=" + contextPath);
|
System.out.println("\n\n==>系统启动成功!server.port=" + serverPort + " context-path=" + contextPath);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user