File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Android Security Essentials Live Lessons this week in the Android 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%
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting ServletContext
 
Similar Threads
Context
can we use servletcontext in a normal java class
Servlet Context Issue
how to call a servlet from jsf managed bean?
2 ways of getting a RequestDispatcher