|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.mortbay.HTTP.Handler.ServletContextWrapper
Servlet Context wrapper class. This class wraps the context provided by the HttpServer in order to allow servlet specific resource bases
Constructor Summary | |
ServletContextWrapper(HttpServer context,
java.lang.String resourceBase)
|
Method Summary | |
java.lang.Object |
getAttribute(java.lang.String name)
Returns an attribute of the server given the specified key name. |
java.util.Enumeration |
getAttributeNames()
. |
javax.servlet.ServletContext |
getContext(java.lang.String url)
Returns a ServletContext object that
corresponds to a specified URL on the server. |
int |
getMajorVersion()
Returns the major version of the Java Servlet API that this Web server supports. |
java.lang.String |
getMimeType(java.lang.String file)
Returns the mime type of the specified file, or null if not known. |
int |
getMinorVersion()
Returns the minor version of the Servlet API that this Web server supports. |
java.lang.String |
getRealPath(java.lang.String path)
Applies alias rules to the specified virtual path and returns the corresponding real path. |
javax.servlet.RequestDispatcher |
getRequestDispatcher(java.lang.String path)
Get a RequestDispatcher. |
java.net.URL |
getResource(java.lang.String path)
Get a resource. |
java.io.InputStream |
getResourceAsStream(java.lang.String path)
Get a resource as a Stream. |
java.lang.String |
getServerInfo()
Returns the name and version of the Web server under which the servlet is running. |
javax.servlet.Servlet |
getServlet(java.lang.String name)
Deprecated. |
java.util.Enumeration |
getServletNames()
Deprecated. |
java.util.Enumeration |
getServlets()
Deprecated. Use getServletNames & getServlet |
void |
log(java.lang.Exception e,
java.lang.String message)
Deprecated. |
void |
log(java.lang.String message)
Writes a message to the servlet log file. |
void |
log(java.lang.String message,
java.lang.Throwable th)
Writes a message to the servlet log file. |
void |
removeAttribute(java.lang.String name)
. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public ServletContextWrapper(HttpServer context, java.lang.String resourceBase)
Method Detail |
public javax.servlet.Servlet getServlet(java.lang.String name)
name
- the name of the servletpublic java.util.Enumeration getServlets()
public java.util.Enumeration getServletNames()
public javax.servlet.ServletContext getContext(java.lang.String url)
ServletContext
object that
corresponds to a specified URL on the server.
This method allows servlets to gain
access to the resources located at a specified URL and obtain
RequestDispatcher
objects from it.
In security conscious environments, the servlet engine can
return null
for a given URL.
uripath
- a String
specifying the URL for
which you are requesting a ServletContext
objectServletContext
object that
corresponds to the named URLRequestDispatcher
public int getMajorVersion()
public int getMinorVersion()
public java.net.URL getResource(java.lang.String path) throws java.net.MalformedURLException
path
- URL path of resourcepublic java.io.InputStream getResourceAsStream(java.lang.String path)
path
- URL path of resourcegetResource(String path)
public javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String path)
path
- URL path of resourcepublic void log(java.lang.String message)
message
- the message to be writtenpublic void log(java.lang.String message, java.lang.Throwable th)
message
- the message to be writtenth
- Throwablepublic void log(java.lang.Exception e, java.lang.String message)
message
- the message to be writtenpublic java.lang.String getRealPath(java.lang.String path)
path
- the real path to be translatedpublic java.lang.String getMimeType(java.lang.String file)
file
- file name whose mime type is requiredpublic java.lang.String getServerInfo()
String
containing at least the
servlet engine name and version numberpublic java.lang.Object getAttribute(java.lang.String name)
name
- the attribute key namepublic java.util.Enumeration getAttributeNames()
Enumeration
of attribute
namesServletContext.getAttribute(java.lang.String)
public void setAttribute(java.lang.String name, java.lang.Object value)
name
- a String
specifying the name
of the attributeobject
- an Object
representing the
attribute to be given the namepublic void removeAttribute(java.lang.String name)
name
- a String
specifying the name
of the attribute to be removed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |