I am trying to setup a session scoped bean but the spring document said that session scope is only applicable on web-aware application context. No further explanation in the doc. Can someone clarify this?
This means that you can only use the session scoped beans in a an application deployed to a web server. Spring can be used in applications that run in standard JVMs along with applications that run in servlet containers (Tomcat, etc). Session, however, only exists in web servers so it has no meaning if the application is running in a standard desktop environment.
There are basically 5 types of scopes available for spring bean. 1)Singleton 2)Prototype 3)Request 4)Session 5)Global-Session
The first two scopes can be used with any type of spring applications. But the remaining 3 are related to web applications. They can be used only with the spring applications which are involved in web.
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