J2EE api中对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.
常用的方法:
1 ServletContext getContext(String uripath)
Returns a ServletContext
object that corresponds to a specified URL on the server.
2 ServletContext getConextpath()
Returns the context path of the web application.
3 getRealPath(String path)
Returns a String
containing the real path for a given virtual path.