簡體   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