Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes ServletContext object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "ServletContext object " Watch "ServletContext object " New topic

ServletContext object

naresh govindaswmay
Ranch Hand

Joined: Aug 15, 2007
Posts: 90
The ServletContext object are accessible from which of the following objects?
Please select three correct answers.

Here i have selected A,B and D answer.but they told A,C and D is the answer.Please anybody clear this doubt.I am waiting for the updates.

Thanks and Regards<br />Naresh govindaswamy
Remko Strating
Ranch Hand

Joined: Dec 28, 2006
Posts: 893
The method from the HttpSession exists but is depreciated from version 2.1 and should not used anymore.

Generic servlet is a abstract class and can not be initialized but implements the servlet interface. The HttpServlet uses the inherited method from Generic Servlet for getting the ServletContext getServletContext.

Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
Christophe Verré

Joined: Nov 24, 2005
Posts: 14687

The method from the HttpSession exists but is depreciated from version 2.1 and should not used anymore.

Is it ? Please check that statement again.

[My Blog]
All roads lead to JavaRanch
James Mark
Ranch Hand

Joined: Jul 05, 2007
Posts: 115
ServletContext object can also be obtained from
public ServletContext getContext(java.lang.String uripath) method in the
ServletContext interface

SCJP1.4(96%) SCWCD1.4(92%)
I agree. Here's the link:
subject: ServletContext object
Similar Threads
Mock Question Doubt
ServletContext Object?
Question On Thread Safety
Best way
Context Path Issue in Struts