This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes SessionAttributes Doubt? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "SessionAttributes Doubt?" Watch "SessionAttributes Doubt?" New topic
Author

SessionAttributes Doubt?

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9398
    
    2

Guys,

The statement, "Attributes bound into a session are available to any other servlet that belongs to the same ServletContext" Will this be true or false?? if true why?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9398
    
    2

Any help guys?? I got this statement from HFSJ book!
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707

"Attributes bound into a session are available to any other servlet that belongs to the same ServletContext"


There is one ServletContext object per web application per JVM. If all session objects belong to one web application as are, attributes bound to
session will be available to any servlet that belong to that particular
web-app.

It is what I could thought to be.


Thanks,


cmbhatt
Amol Nayak
Ranch Hand

Joined: Oct 26, 2006
Posts: 218
If the webapp is distributed the same Session object is used, but the ServletContext is one per jvm..

So

"Attributes bound into a session are available to any other servlet that belongs to the same ServletContext"

Is not true.. It can also be accessed from different ServletContext of the same distributed webapp.


Amol...
jayaram parisineni
Greenhorn

Joined: Apr 27, 2006
Posts: 6
Session attributes are not accessible by all servlets in a web - application, they are accessible by any servlet or Jsp which access that particular session.So the answer is false and reason is what i explained.


Thanks,

Jayaram
 
GeeCON Prague 2014
 
subject: SessionAttributes Doubt?