• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ServletContext access doubt

 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
41.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


The above Question i got from moxk exam in which they have given correct answer as A , C and D... But i think answer should be C, D and E...So please explain me if i'm wrong.

Thanks;
Brijesh
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You'll find the answer yourself in the API. Look at these classes carefully, and remember which methods they contain.
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Based on following API info, Answer should be A,B,C and D.
There are 4 correct options instead of 3.

http://java.sun.com/webservices/docs/1.4/api/javax/servlet/GenericServlet.html
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpSession.html
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServlet.html
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletConfig.html
all have getServletContext() method, which proves ServletContext is accessible.

and

http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletResponse.html
does not have getServletContext() method..

Please correct me if I am wrong.

Regards,
Swathi.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic