It's not a secret anymore!*
The moose likes Spring and the fly likes request and session spring scopes in standalone  apps Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "request and session spring scopes in standalone  apps" Watch "request and session spring scopes in standalone  apps" New topic
Author

request and session spring scopes in standalone apps

seenu java
Greenhorn

Joined: Oct 03, 2011
Posts: 12


Hi,
What happens if we use "request" and "session" scopes(in spring) in standalone(desktop) applications?
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 597

What do you think will happen? What does the documentation say will happen?


Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
Miku Ranjan
Ranch Hand

Joined: Oct 11, 2011
Posts: 98
Hi,
request and session scope is for only web application not for standalone application.
seenu java
Greenhorn

Joined: Oct 03, 2011
Posts: 12
Sam: i could not find the answer in documentation,if you know the answer please post it.

Ranjan: i know we should not use in Standalone applications,but if we use what happens?
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 597

4.5.4 Request, session, and global session scopes

The request, session, and global session scopes are only available if you use a web-aware Spring ApplicationContext implementation (such as XmlWebApplicationContext). If you use these scopes with regular Spring IoC containers such as the ClassPathXmlApplicationContext, you get an IllegalStateException complaining about an unknown bean scope.

http://static.springsource.org/spring/docs/3.1.0.RC1/spring-framework-reference/html/beans.html#beans-factory-scopes-other
seenu java
Greenhorn

Joined: Oct 03, 2011
Posts: 12
Thanks Sam.
 
Don't get me started about those stupid light bulbs.
 
subject: request and session spring scopes in standalone apps
 
Similar Threads
Is there a way to pass parameters dynamically to forward tag in struts-config.xml
Context Parameters
Servlet scopes vs. bean scopes in Spring
Spring
Doubt Regarding implicit objects