But the engine says its A,C,D. But when I read the explanation (shown below in bold), it seems that it's really the GenericServlet who has the access to ServletContext object and not HttpSession. Is this an error for the engine? or am I missing something here?
I've searched for the HttpSession API and found out that it has a method named getSessionContext() that returns the context in which the session is bound. But this method is already deprecated. So I think the best choice are HttpServlet, GenericServlet, and ServletConfig if the question asks for 3 answers. And just add the HttpSession if the question requires 4 answers. I just hope this won't be the same case in the real exam.
Thanks again to you guys!
Joined: Sep 03, 2005
Hi, getSessionContext() is deprecated. Not getServletContext(). Correct me if I am wrong.
Raj you're right, he got confused I guess only getSessionContext is deprecated, getServletContext is not
I think the question should have had 4 options as answers, nothing to worry about Rex, as long as u have the specs to back you up, there's no need to worry about the answers in the mock engines, the real exam will definitely be more consistent.