• Post Reply Bookmark Topic Watch Topic
  • New Topic

ServletContext object

 
naresh govindaswmay
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
The ServletContext object are accessible from which of the following objects?
Please select three correct answers.
A.HttpServlet
B.GenericServlet
C.HttpSession
D.ServletConfig
E.ServletResponse


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.
 
Remko Strating
Ranch Hand
Posts: 893
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
James Mark
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServletContext object can also be obtained from
public ServletContext getContext(java.lang.String uripath) method in the
ServletContext interface
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!