File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Attribute in ServletContext Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Attribute in ServletContext" Watch "Attribute in ServletContext" New topic

Attribute in ServletContext

Haroldo Nascimento
Ranch Hand

Joined: Aug 14, 2003
Posts: 79
If I put attributes in the ServletContext I have the problem that this attributes will be visible per everybody ??? Using session I dont have this problem, because session is per browser. OK?
john smith
Ranch Hand

Joined: Mar 04, 2004
Posts: 75
There is one ServletContext per application so yes attributes of this object are avaliable application-wide. The Session object is bound to a particular session id and so is avaliable only to a particular client session.
I agree. Here's the link:
subject: Attribute in ServletContext
jQuery in Action, 3rd edition