Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Servlet Context  RSS feed

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all -

In the Section 3 quiz of Marcus' study guide. Question 5 is as follows:

Which of the following statements are true?
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

A and C are listed as the correct answers.

My question is that shouldn't B also be correct. Isn't the ServletContext available to the servlet via the getServletContext() method?

Thanks
Mark
 
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i agree
 
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe the author intended to ask if every servlets has access to only one common context, which would be wrong in a distributed environment.
Maybe a subtle difference between "each instance of" and "every instance of"...
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!