• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

marcus green mock exam  RSS feed

 
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A & C?!!??!

Cheers,
Naren

SCJP - 93%
SCDJWS - 86%
SCWCD - ?
 
If you believe you can tell me what to think, I believe I can tell you where to go. Go read this tiny ad!
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!