Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

web application context and servlet context

 
david hu
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am confusion about the term "context". Is web application context same as the servlet context? Can anyone tell me a good site or book about the explanation of the term context and detailed info about servlet mapping?
Thanks
 
Anthony Villanueva
Ranch Hand
Posts: 1055
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to the docs, the ServletContext

... defines a set of methods that a servlet uses to communicate with its servlet container, for example, to get the MIME type of a file, dispatch requests, or write to a log file.
There is one context per "web application" per Java Virtual Machine. (A "web application" is a collection of servlets and content installed under a specific subset of the server's URL namespace such as /catalog and possibly installed via a .war file.)

Its methods are commonly used to pass data between servlets in a web application. Please see the Sun tutorial.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic