This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Servlets and the fly likes Doubt in Session Scope Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Doubt in Session Scope" Watch "Doubt in Session Scope" New topic
Author

Doubt in Session Scope

Ravi Bansal
Ranch Hand

Joined: Aug 18, 2008
Posts: 84
I read the below sentence somewhere..

"Any object bound into a session is available to any other servlet that belongs to the same ServletContext "

Can anyone tel me if ithe above statement is correct ?

if one client sends a request to some servlet and sets some attribute in session object , then second client sends the request to same servlet (or some other servlet belonging to same servlet context) , how can a second client access attribute in the session object set by first client , as second client wil have a different session with the server.?


SCJP 5.0 94%
OCE-EJBD 90%
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61103
    
  66

It is not correct.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Mateus Lucio
Ranch Hand

Joined: Jul 27, 2006
Posts: 57
Depend on how you read it ...

An object bound to a session is available to any servlet that belongs to the same ServletContext as long as the requests are been sent by the same client.

I read it in HFSJ ... took me sometime to understand it, but i don't consider that sentence wrong, I just think it's incomplete.


Studying ...
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61103
    
  66

Almost any sentence can be made correct if you add more words or context to it. But simply as written in the original post without further info, it is not correct.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt in Session Scope