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

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.

主站蜘蛛池模板: 康平县| 台中市| 萝北县| 西昌市| 遂宁市| 三门县| 崇礼县| 永仁县| 永修县| 双鸭山市| 改则县| 海门市| 城口县| 塔河县| 临汾市| 永修县| 西丰县| 霍山县| 高陵县| 防城港市| 黄石市| 永和县| 荔浦县| 阜康市| 龙江县| 溆浦县| 台北县| 临沭县| 南澳县| 哈尔滨市| 府谷县| 威远县| 邯郸市| 英超| 淮南市| 海淀区| 化州市| 乐业县| 建始县| 墨江| 阳曲县|