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

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.

主站蜘蛛池模板: 西峡县| 延吉市| 远安县| 宜良县| 新化县| 吉安市| 清原| 阿坝| 邓州市| 天峻县| 东莞市| 通榆县| 青阳县| 什邡市| 黄陵县| 离岛区| 衡水市| 雅安市| 蓝山县| 西藏| 永泰县| 建瓯市| 顺义区| 行唐县| 山西省| 平顺县| 台南县| 久治县| 沾益县| 三门峡市| 游戏| 汾西县| 扎赉特旗| 玉龙| 临朐县| 平定县| 志丹县| 巫溪县| 五河县| 长白| 许昌县|