深入Spring Boot:Spring Context的继承关系和影响
前言
对于一个简单的Spring boot应用,它的spring context是只会有一个。
- 非web spring boot应用,context是
AnnotationConfigApplicationContext - web spring boot应用,context是
AnnotationConfigEmbeddedWebApplicationContext
AnnotationConfigEmbeddedWebApplicationContext是spring boot里自己实现的一个context,主要功能是启动embedded servlet container,比如tomcat/jetty。
这个和传统的war包应用不一样,传统的war包应用有两个spring context。参考:http://hengyunabc.github