繁体   English   中英

如何在Spring Boot和@GetMapping中结束服务

[英]How to end a service in Spring boot and @GetMapping

我已经用Spring Boot开发了一个服务REST,但是当我生成并执行.jar时,我不知道如何完成它。 (我不喜欢使用Ctrl + Alt + Supr)。

有谁知道如何退出(Spring Boot / REST服务的)应用程序,例如:

@GetMapping()
public void endApplication(){
 .....End Application .....
}

通常,服务的重点是无限期地运行。

但是,在您的示例中,您可以通过以下方式实现它:

@GetMapping()
public void endApplication(){
    System.exit(0);
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM