代码如下:
public static void main(String[] args) throws IOException, SQLException {
ConfigurableApplicationContext application = SpringApplication.run(ServiceApplication.class, args);
String port = application.getEnvironment().getProperty("server.port");
Runtime runtime = Runtime.getRuntime();
runtime.exec("rundll32 url.dll,FileProtocolHandler "+"http://localhost:"+port+"/table/errorInfo");
}
这段代码展示了如何通过Spring Boot启动应用程序,并获取服务器端口。然后利用Runtime类执行命令,打开一个本地URL,该URL指向的是`/table/errorInfo`路径。这可能是一个错误处理或信息展示页面。
3万+

被折叠的 条评论
为什么被折叠?



