Forums Register Login

ServletContext access doubt

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
You'll find the answer yourself in the API. Look at these classes carefully, and remember which methods they contain.
+Pie Number of slices to send: Send
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.
That's a very big dog. I think I want to go home now and hug this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 816 times.
Similar Threads
Behaviour of distributed web application.
For JSP scopes of request and page, what type of object is used to store the attribut
ServletContext object
ServeltContext object
www.jiris.com exam blunder
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 14:15:44.