Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ServletContext Interface

 
peter hodge
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServletContext is an interface. It's methods don't have a body. Where is the code for "context.getAttribute()" coming from?
ServletContext context = getServletContext();
String s = (String)context.getAttribute("myAttribute");
What am I missing?
 
Win Yu
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think sevlet API did not have document for ServletContext class, only for interface.That is why you do not know the where it is.But I am not sure.
 
Eduardo Cobian
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This interface like many others comes implemented in the servlet container.You just uses the supertype to acces the methods of the object the servlet container provides for you.(I think).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic