• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet Context Attributes.. global?  RSS feed

 
Paul McKenna
Ugly Redneck
Ranch Hand
Posts: 1006
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..
Is the Servlet Context globally available to all servlets in all sessions or specific to a particular session.
If I invoke the set attribute on the Servlet Context from a servlet in a particular session, can another servlet handling another session obtain that attribute?
Thanks
SR
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The servlet context is specific to the web application that the servlet is in. So if you set something in the ontext in one servlet it is available to all other servlets in the same web app regardless of the session.
hope that helps
 
Anthony Villanueva
Ranch Hand
Posts: 1055
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

If I invoke the set attribute on the Servlet Context from a servlet in a particular session, can another servlet handling another session obtain that attribute?

Yes, as long you are talking about servlets that belong to the same web application.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!