This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
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 Elasticsearch in Action this week in the Big Data 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: 14688

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