• 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

marcus green mock exam

 
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?
 
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I thing they mean to say,
Every Servlet Instance have its own servletContext object that is wrong.
 
vani venkat
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sailesh, it doesnot sound like that. is it mentioned anywhere that option B should be interpreted that way?
 
Shailesh Narkhede
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Ranch Hand
Posts: 577
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A & C?!!??!

Cheers,
Naren

SCJP - 93%
SCDJWS - 86%
SCWCD - ?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic