Issue
What is the difference between the singleton and application spring scopes ?
I know that the singleton scope creates one instance per application and the application scope is working in the same way, then what is the main difference ?
I need an example to shows me the difference.
Solution
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' (for which there may be several in any given web application), and it is actually exposed and therefore visible as a ServletContext attribute.
i.e. web application may have several Spring application contexts and therefore several instances of bean with singleton scope (one instance per spring app contexts) but only one bean defined with application scope.
Answered By - Evgeny
Answer Checked By - Katrina (JavaFixing Volunteer)