|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A class created by the server to give servlets access to certain
environment related objects and methods.
It contains standard information like the names of all the servlets,
two kinds of log methods, the server name, etc.
The server can also store extra information here in the form
of {String, Object} pairs.
Different servlets can live in different ServletContexts,
but a servlet engine can group related Servlets in the same
ServletContext.
Servlet specific information can be transferred to a servlet using
a class implementing the ServletConfig interface.
Method Summary | |
java.lang.Object |
getAttribute(java.lang.String name)
Gets the value of a named attribute |
java.lang.String |
getMimeType(java.lang.String filename)
Gives the mimetype of the requested file |
java.lang.String |
getRealPath(java.lang.String virtualPath)
Translates the requested virtual path to the real filesystem path using the servers knowledge of the document root. |
java.lang.String |
getServerInfo()
A server supplied string containing the server name, version number, etc |
Servlet |
getServlet(java.lang.String name)
Gets a specific servlet by name. |
java.util.Enumeration |
getServletNames()
Gets all servlet names |
java.util.Enumeration |
getServlets()
Deprecated. Always returns an empty Enumeration. Only the servlet engine should have references to Servlets. |
void |
log(java.lang.Exception exception,
java.lang.String message)
Writes an exception + message to the log |
void |
log(java.lang.String message)
Writes a message to the log |
Method Detail |
public java.lang.Object getAttribute(java.lang.String name)
name
- the name of the attributepublic java.lang.String getMimeType(java.lang.String filename)
filename
- the filepublic java.lang.String getRealPath(java.lang.String virtualPath)
virtualPath
- the path to be translated
(e.g. /graphics/baby-gnu.png
)public java.lang.String getServerInfo()
public void log(java.lang.String message)
message
- the message to writepublic void log(java.lang.Exception exception, java.lang.String message)
exception
- the exceptionmessage
- the messagepublic Servlet getServlet(java.lang.String name) throws ServletException
name
- the name of the wanted servletpublic java.util.Enumeration getServlets()
public java.util.Enumeration getServletNames()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |