Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet Context Attributes.. global?

 
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic