I'm reading the spring framework documentation and now I'm at application scope concept. What the documentation says about that concept is this:
This is somewhat similar to a Spring singleton bean but differs in two important ways: It is a singleton per ServletContext, not per Spring ApplicationContext
To me, what's unclear is how can we imagine the relationship between Spring application context and Servlet context.
I'd assume that there two possible cases for the relationship between them:
I
II
So, how does the Spring application context relate with Servlet context? Is it case I or case II or neither of them?
It's neither of them.
ServletContext is the standard Java EE application scope. Each deployed webapp has one and only one servlet context.
Inside this webapp, you can have one (typically) or several Spring application contexts: one per Spring-MVC dispatcher servlet.