W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
The final part of our application is the main
method. This is just a standard method that follows the Java convention for an application entry point. Our main method delegates to Spring Boot’s SpringApplication
class by calling run
. SpringApplication
bootstraps our application, starting Spring, which, in turn, starts the auto-configured Tomcat web server. We need to pass Example.class
as an argument to the run
method to tell SpringApplication
which is the primary Spring component. The args
array is also passed through to expose any command-line arguments.
應(yīng)用程序最后部分是 main
方法。 這僅僅是一個標(biāo)準(zhǔn)方法,它遵循Java應(yīng)用程序進(jìn)入點的規(guī)范。 我們的main
方法通過調(diào)用 run
來委托SpringBoot的SpringApplication
類。 SpringApplication
引導(dǎo)啟動應(yīng)用程序,從Spring開始,依次啟動自動配置的Tomcat Web服務(wù)器。 我們需要將 Example.class
作為一個參數(shù)傳遞給 run
方法來告訴SpringApplication
哪個是主要的Spring組件。(main方法)args
數(shù)組同樣被傳遞暴露于任意命令行的參數(shù)。
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: