Interface java.servlet.ServletContext
All Packages Class Hierarchy This Package Previous Next Index
Interface java.servlet.ServletContext
- public interface ServletContext
- extends Object
An interface for defining a servlet's environment. It is used by
a servlet to obtain information about the environment (i.e. Web
server) in which it is running.
-
getServerInfo()
- Returns the name and version of the Web server under which the
servlet is running.
-
getServlet(String)
- Gets a servlet by name.
-
getServlets()
- Enumerates the servlets in this context (server).
-
log(Servlet, String)
- Writes a message to the servlet log for a servlet.
getServlet
public abstract Servlet getServlet(String name)
- Gets a servlet by name.
- Parameters:
- name - the name of the servlet
- Returns:
- null if the servlet does not exist
getServlets
public abstract Enumeration getServlets()
- Enumerates the servlets in this context (server). Only servlets
that are accessible will be returned. The enumeration always
includes the servlet itself.
log
public abstract void log(Servlet servlet,
String msg)
- Writes a message to the servlet log for a servlet.
- Parameters:
- servlet - the servlet to log information about
- msg - the message to log
getServerInfo
public abstract String getServerInfo()
- Returns the name and version of the Web server under which the
servlet is running. Same as the CGI variable SERVER_SOFTWARE.
All Packages Class Hierarchy This Package Previous Next Index