|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.grizzly.http.servlet.ServletContextImpl
public class ServletContextImpl
Constructor Summary | |
---|---|
ServletContextImpl()
|
Method Summary | |
---|---|
Object |
getAttribute(String name)
Return the value of the specified context attribute, if any; otherwise return null . |
Enumeration |
getAttributeNames()
Return an enumeration of the names of the context attributes associated with this context. |
protected String |
getBasePath()
Return the current based path. |
ServletContext |
getContext(String uri)
Return a ServletContext object that corresponds to a
specified URI on the server. |
String |
getContextPath()
|
String |
getInitParameter(String name)
Return the value of the specified initialization parameter, or null if this parameter does not exist. |
Enumeration |
getInitParameterNames()
Return the names of the context's initialization parameters, or an empty enumeration if the context has no initialization parameters. |
int |
getMajorVersion()
Return the major version of the Java Servlet API that we implement. |
String |
getMimeType(String file)
Return the MIME type of the specified file, or null if
the MIME type cannot be determined. |
int |
getMinorVersion()
Return the minor version of the Java Servlet API that we implement. |
RequestDispatcher |
getNamedDispatcher(String arg0)
|
String |
getRealPath(String path)
Return the real path for a given virtual path, if possible; otherwise return null . |
RequestDispatcher |
getRequestDispatcher(String arg0)
|
URL |
getResource(String path)
Return the URL to the resource that is mapped to a specified path. |
InputStream |
getResourceAsStream(String path)
Return the requested resource as an InputStream . |
Set |
getResourcePaths(String path)
Return a Set containing the resource paths of resources member of the specified collection. |
String |
getServerInfo()
|
Servlet |
getServlet(String name)
Deprecated. As of Java Servlet API 2.1, with no direct replacement. |
String |
getServletContextName()
|
Enumeration |
getServletNames()
Deprecated. As of Java Servlet API 2.1, with no direct replacement. |
protected String |
getServletPath()
Set the context-path. |
Enumeration |
getServlets()
Deprecated. As of Java Servlet API 2.1, with no direct replacement. |
void |
log(Exception e,
String msg)
|
void |
log(String string)
|
void |
log(String msg,
Throwable t)
|
void |
removeAttribute(String name)
Remove the context attribute with the specified name, if any. |
void |
setAttribute(String name,
Object value)
Bind the specified value with the specified context attribute name, replacing any existing value for that name. |
protected void |
setBasePath(String basePath)
Set the basePath used by the getRealPath(java.lang.String) . |
protected void |
setContextPath(String contextPath)
Programmatically set the context path of the Servlet. |
protected void |
setInitParameter(HashMap<String,String> parameters)
|
protected void |
setServletPath(String servletPath)
Programmaticaly set the servlet path value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServletContextImpl()
Method Detail |
---|
public String getContextPath()
getContextPath
in interface ServletContext
protected void setContextPath(String contextPath)
contextPath
- public ServletContext getContext(String uri)
ServletContext
object that corresponds to a
specified URI on the server. This method allows servlets to gain
access to the context for various parts of the server, and as needed
obtain RequestDispatcher
objects or resources from the
context. The given path must be absolute (beginning with a "/"),
and is interpreted based on our virtual host's document root.
getContext
in interface ServletContext
uri
- Absolute URI of a resource on the serverpublic int getMajorVersion()
getMajorVersion
in interface ServletContext
public int getMinorVersion()
getMinorVersion
in interface ServletContext
public String getMimeType(String file)
null
if
the MIME type cannot be determined.
getMimeType
in interface ServletContext
file
- Filename for which to identify a MIME typepublic Set getResourcePaths(String path)
getResourcePaths
in interface ServletContext
path
- Collection path
TODO: Not yet supportedpublic URL getResource(String path) throws MalformedURLException
getResource
in interface ServletContext
path
- The path to the desired resource
MalformedURLException
- if the path is not given
in the correct formpublic InputStream getResourceAsStream(String path)
InputStream
. The
path must be specified according to the rules described under
getResource
. If no such resource can be identified,
return null
.
getResourceAsStream
in interface ServletContext
path
- The path to the desired resource.public RequestDispatcher getRequestDispatcher(String arg0)
getRequestDispatcher
in interface ServletContext
public RequestDispatcher getNamedDispatcher(String arg0)
getNamedDispatcher
in interface ServletContext
public Servlet getServlet(String name)
getServlet
in interface ServletContext
public Enumeration getServlets()
getServlets
in interface ServletContext
public Enumeration getServletNames()
getServletNames
in interface ServletContext
public void log(String string)
log
in interface ServletContext
public void log(Exception e, String msg)
log
in interface ServletContext
public void log(String msg, Throwable t)
log
in interface ServletContext
public String getRealPath(String path)
null
.
getRealPath
in interface ServletContext
path
- The path to the desired resourcepublic String getServerInfo()
getServerInfo
in interface ServletContext
public String getInitParameter(String name)
null
if this parameter does not exist.
getInitParameter
in interface ServletContext
name
- Name of the initialization parameter to retrievepublic Enumeration getInitParameterNames()
getInitParameterNames
in interface ServletContext
protected void setInitParameter(HashMap<String,String> parameters)
public Object getAttribute(String name)
null
.
getAttribute
in interface ServletContext
name
- Name of the context attribute to returnpublic Enumeration getAttributeNames()
getAttributeNames
in interface ServletContext
public void setAttribute(String name, Object value)
setAttribute
in interface ServletContext
name
- Attribute name to be boundvalue
- New attribute value to be boundpublic void removeAttribute(String name)
removeAttribute
in interface ServletContext
name
- Name of the context attribute to be removedpublic String getServletContextName()
getServletContextName
in interface ServletContext
protected String getServletPath()
protected void setServletPath(String servletPath)
servletPath
- protected String getBasePath()
protected void setBasePath(String basePath)
getRealPath(java.lang.String)
.
basePath
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |