aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Getting ServletContext Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Getting ServletContext" Watch "Getting ServletContext" New topic
Author

Getting ServletContext

Karne Reddy
Ranch Hand

Joined: May 28, 2006
Posts: 35
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


asdfa
Sunder Ganapathy
Ranch Hand

Joined: Apr 01, 2003
Posts: 120
You can get it from ServletConfig, HttpSession, Generic Servlet and Of course
from ServletContext itself as getContext.
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Hi,

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

Thanks


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
Senthil Kumar
Ranch Hand

Joined: Mar 13, 2006
Posts: 264
Hi,

And also from FilterConfig


when you really want something, all the universe always conspires in your favour.<br /> <br />SCJP1.5-77%<br />SCWCD-89%
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Getting ServletContext