Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does it mean in Spring 3, web-aware application context

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?

like image 585
user241178 Avatar asked Nov 08 '11 21:11

user241178


2 Answers

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.

like image 136
Chris Thompson Avatar answered Oct 03 '22 23:10

Chris Thompson


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.

like image 43
SivaRaju Penuboina Avatar answered Oct 04 '22 00:10

SivaRaju Penuboina