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

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.

主站蜘蛛池模板: 泉州市| 汉中市| 太仓市| 徐水县| 三门峡市| 玛纳斯县| 井陉县| 安图县| 肥东县| 江阴市| 沧州市| 呼图壁县| 荆州市| 安乡县| 关岭| 思茅市| 龙南县| 洛浦县| 武宁县| 宜都市| 察隅县| 泰宁县| 隆安县| 庆元县| 德庆县| 晋城| 林周县| 昌乐县| 易门县| 西畴县| 房山区| 昆明市| 喀什市| 运城市| 安溪县| 广饶县| 泗水县| 攀枝花市| 视频| 肥城市| 长岭县|