• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting ServletContext

 
Karne Reddy
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In how many ways can we get the ServletContext Object and from which objects?

In one mock test, I have seen tat we can get ServletContext from HttpServlet class instead of GenericServlet class?


AdvaNcely thanx
-----------
SCJP
 
Sunder Ganapathy
Ranch Hand
Posts: 120
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can get it from ServletConfig, HttpSession, Generic Servlet and Of course
from ServletContext itself as getContext.
 
Narendra Dhande
Ranch Hand
Posts: 951
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Also from ServletContextEvent, ServletContextAttributeEvent, HttpSession and pageContext object in JSP.

Thanks
 
Senthil Kumar
Ranch Hand
Posts: 264
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

And also from FilterConfig
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic