springboot支持三种嵌入式servlet容器:tomcat(默认),jetty,undertow

默认是使用tomcat容器的:

springboot支持三种嵌入式servlet容器:tomcat(默认),jetty,undertow

web模块排除tomcat依赖:

springboot支持三种嵌入式servlet容器:tomcat(默认),jetty,undertow

引入jetty容器:

springboot支持三种嵌入式servlet容器:tomcat(默认),jetty,undertow

启动项目看日志(已经成功切换到jetty):

springboot支持三种嵌入式servlet容器:tomcat(默认),jetty,undertow

关键是,与tomcat保持一样的配置(一样的配方,不一样的味道):

springboot支持三种嵌入式servlet容器:tomcat(默认),jetty,undertow

再整体来看一下:

springboot支持三种嵌入式servlet容器:tomcat(默认),jetty,undertow

再比如,切换成undertow容器:

springboot支持三种嵌入式servlet容器:tomcat(默认),jetty,undertow

springboot支持三种嵌入式servlet容器:tomcat(默认),jetty,undertow

看日志,已经成功切换到undertow了:

springboot支持三种嵌入式servlet容器:tomcat(默认),jetty,undertow

相关文章: