• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

www.jiris.com exam blunder

 
Sreeraj G Harilal
Ranch Hand
Posts: 310
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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


I choose B,C,D but the result says A,C,D.

What's your opinion?
 
Sayak Banerjee
Ranch Hand
Posts: 292
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are 4 correct answers:-
A,B,C,D

E is incorrect
 
Prabhu Venkatachalam
Ranch Hand
Posts: 502
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Answers are

A : HttpServlet
B : GenericServlet
C : HttpSession
D : ServletConfig
 
Sreeraj G Harilal
Ranch Hand
Posts: 310
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HttpServlet class does not have any method like getServletContext()

getServletContext() is the method of GenericServlet class, base class of HttpServlet.

Then how the option A is correct?
 
Prabhu Venkatachalam
Ranch Hand
Posts: 502
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the question carefully. It is about runtime behavior. At runtime, you can use both servlet class objects to access ServletContext.
[ December 09, 2006: Message edited by: Prabhu venkatachalam ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic