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

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.

主站蜘蛛池模板: 保靖县| 康保县| 彭山县| 界首市| 屯门区| 清流县| 大洼县| 尉犁县| 乡城县| 阿拉尔市| 曲麻莱县| 阳谷县| 酒泉市| 土默特左旗| 新晃| 封丘县| 琼海市| 天津市| 泸溪县| 佛冈县| 本溪| 淳安县| 凤山县| 札达县| 玛纳斯县| 宜春市| 卓尼县| 奇台县| 互助| 建昌县| 长丰县| 云安县| 信丰县| 灵石县| 德化县| 连山| 盈江县| 永登县| 霍州市| 开鲁县| 佛坪县|