1. Servlet Context
It is initilized when an servlet application is deployed. Servlet Context holds all the configurations (init-prarm, context-params etc) of the of the whole servlet application.
2. Application Context
Is is a spring thing. It is initilized by Spring. It holds all the bean defination and life-cycle of the of the beans that is defined inside the spring configuraion files. Servlet-Context has no idea about this things.
There are two types of context in spring parent and child.
Spring Parent Context (Application Context / Root Context )
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/service-context.xml,
/WEB-INF/dao-context.xml,
/WEB-INF/was-context.xml,
/WEB-INF/jndi-context.xml,
/WEB-INF/json-context.xml
</param-value>
</context-param>
Spring Child Context ( WebApplicationContext / Child Context )
<servlet>
<servlet-name>myWebApplication</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>jobbuzz-web</servlet-name>
<url-pattern>/app/*</url-pattern>
</servlet-mapping>
when spring web application starts it will look for spring bean configration file myWebApplication-servlet.xml. It will read all the bean definations and create and manages the bean objects life cycle. If parent spring context is available it will merge the child spring context with the parent spring context. If there is not spring parent context the application will have only child spring context.
References:
1. ApplicationContext and ServletContext