
上QQ阅读APP看书,第一时间看更新
2.7 使用Jetty容器
SpringBoot在项目启动时默认情况下使用的是Tomcat容器,这一点可以通过日志直观看到。

在实际的开发过程中,开发者往往会选择Jetty作为Web容器,由于SpringBoot也支持Jetty容器,所以开发者只需要修改pom.xml配置文件即可。
1.【mldnboot-base项目】修改pom.xml文件,使用Jetty容器运行。

2.【mldnboot-base项目】修改完pom.xml文件后,需要重新启动SpringBoot项目,此时就可以在日志中看到如下信息。

程序可以使用小巧的Jetty容器来运行SpringBoot项目,但是这种做法也仅仅是在开发过程中使用,在实际的生产环境下依然推荐使用Tomcat作为Web容器。