As per spring documentaion:-
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' (or which there may be several in any given web application), and it is actually exposed and therefore visible as a ServletContext attribute.
But I am not able to get the above..
The ServletContext is provided by you application server (e.g. tomcat), while you can define multiple Spring Context (application context) for your web application: http://alvinalexander.com/blog/post/java/how-load-multiple-spring-context-files-web-application
But for practical purposes this can neglected. The more interesting fact is that the bean is exposed/visible through the ServletContext: http://docs.spring.io/spring/docs/current/spring-framework-reference/html/beans.html#beans-factory-scopes-application
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With