Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servletcontext

 
ricky gonzalez
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, can someone help me understanding what servlet context is? What does it mean? What does it describe? Where it is at?
Thanks!
 
KASI VISHWANATH
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Defines a set of methods that a servlet uses to communicate with a servlet engine, for example, to get the MIME type of a file, locate other servlets running on the server, or write to a servlet log file.
The servlet engine talks to the servlet by returning a ServletContext object (defined by this interface) that gives servlets information about their environment. Servlets use the ServletConfig.getServletContext() method to get the ServletContext object.
If the server supports multiple or virtual hosts, the ServletContext object must be at least as unique as the host. Servlet engines can also create ServletContext objects that are unique to a group of servlets and are tied to a specific part of the host's URL namespace. You can assign this grouping administratively or define it in a deployment descriptor file.
The ServletContext object is contained within the ServletConfig object, which the Web server provides the servlet when the servlet is initialized. You can access the ServletConfig object by using the Servlet.getServletConfig() method.

------------------
I.K.VISHWANATH
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic