官术网_书友最值得收藏!

Creating an application object

The @SpringBootApplication annotation provides a convenient way to bootstrap a Spring application that can be started from a main() method. In many situations, you can just delegate to the static runApplication method:

@SpringBootApplication
class Chapter2Application

fun main(args: Array<String>) {
runApplication<Chapter2Application>(*args)
}

You can see that we have used the @SpringBootApplication annotation for marking a class that we will use as our application context. We will learn more about the Spring Application Context shortly.

When a Spring Boot application starts it will autoconfigure all the required systems; if it is a web app, it will start a web application.

Spring Boot provides an embedded Tomcat server that will start when our application starts. This is a fully functional server, so it's not required to deploy our software in any application server. However, Spring allows us to do it. We will discuss more on this in the section: Packing and running a Spring Boot application.

The application will also configure and run any other system that we need, such as a connection pool to a database or a queue.

主站蜘蛛池模板: 嘉定区| 西林县| 永昌县| 夏邑县| 碌曲县| 客服| 涞水县| 梅河口市| 德化县| 修水县| 德惠市| 礼泉县| 茂名市| 乐清市| 石柱| 贞丰县| 冕宁县| 望谟县| 阿拉善右旗| 左云县| 炉霍县| 慈溪市| 平武县| 卢龙县| 越西县| 出国| 禹州市| 西青区| 镇坪县| 门头沟区| 伊宁市| 黎川县| 皮山县| 海林市| 景泰县| 阿拉善盟| 龙口市| 雷州市| 南木林县| 邢台市| 金昌市|