It's not a secret anymore!*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes marcus green mock exam Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "marcus green mock exam" Watch "marcus green mock exam" New topic
Author

marcus green mock exam

vani venkat
Ranch Hand

Joined: Nov 21, 2006
Posts: 142

Which of the following statements are true?
Choose at least one answer.
A. Every (non distributed) web application has only one instance of ServletContext
B. Every instance of HttpServlet has only one instance of ServletContext
C. The ServletContext object is retrieved via the getServletContext method of ServletConfig
D. The ServletConfig object is retrieved via the getServletConfig method of ServletContext

Why is option B incorrect here? Every instance of servlet class will have one servlet context associated with it. it can't have multiple instances of servlet context. how is this incorrect?


SCJP 1.4, SCWCD 1.5
Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 368
I thing they mean to say,
Every Servlet Instance have its own servletContext object that is wrong.


Thanks,
Shailesh
vani venkat
Ranch Hand

Joined: Nov 21, 2006
Posts: 142
sailesh, it doesnot sound like that. is it mentioned anywhere that option B should be interpreted that way?
Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 368
B. Every instance of HttpServlet has only one instance of ServletContext


In this statement they had not tell us that context is same for all servlets or not.
might be they mean to say,

Every instance of HttpServlet has its own one instance of ServletContext.
Naren Chivukula
Ranch Hand

Joined: Feb 03, 2004
Posts: 577

A & C?!!??!

Cheers,
Naren

SCJP - 93%
SCDJWS - 86%
SCWCD - ?


Cheers,
Naren
(OCEEJBD6, SCWCD5, SCDJWS, SCJP1.4 and Oracle SQL 1Z0-051)
 
 
subject: marcus green mock exam