现在的容器都支持embedded模式,Spring Boot就是利用这种模式。
Spring Boot支持embedded容器包括:
Tomcat, Jetty or Undertow
Spring Boot项目首页的内容:
FeaturesCreate stand-alone Spring applications
Embed Tomcat, Jetty or Undertow directly (no need to deploy WAR files)
Provide opinionated 'starter' POMs to simplify your Maven configuration
Automatically configure Spring whenever possible
Provide production-ready features such as metrics, health checks and externalized configuration
Absolutely no code generation and no requirement for XML configuration
文档里对embedded的具体说明:Spring Boot includes support for embeddedTomcat,Jetty, andUndertowservers. Most developers use the appropriate “Starter” to obtain a fully configured instance. By default, the embedded server listens for HTTP requests on port8080.
我查了一下你说的
2.0.1又用了Netty
然后再看一下这里的讨论:和springmvc相比有什么比较 突出 的优点啊?底层通讯必须用netty? · Issue #143 · lets-blade/bladegithub.com
Undertow从一开始就被设计成embeded。
官网首页:Undertow is designed to be fully embeddable, with easy to use fluent builder APIs. Undertow’s lifecycle is completely controlled by the embedding application.
推荐你另外一个项目JHipster,是基于Spring Boot和Spring Cloud的,默认内置Undertow。可以关注我的文章:陈龙:用JHipster做Java Web全栈开发zhuanlan.zhihu.com