|
|||||||||
| 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
Simple ServletContext implementation.
| Constructor Summary | |
|---|---|
ServletContextImpl()
|
|
| Method Summary | |
|---|---|
protected void |
destroyListeners()
Stop ServletContextListener |
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. |
protected List<EventListener> |
getListeners()
Return the Servlet Listener. |
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. |
Enumeration |
getServlets()
Deprecated. As of Java Servlet API 2.1, with no direct replacement. |
protected void |
initListeners(ArrayList<String> listeners)
Notify the ServletContextListener that we are starting. |
void |
log(Exception e,
String msg)
|
void |
log(String string)
|
void |
log(String msg,
Throwable t)
|
protected String |
normalize(String path)
Return a context-relative path, beginning with a "/", that represents the canonical version of the specified path after ".." and "." elements are resolved out. |
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. |
void |
setDisplayName(String contextName)
Set the Servlet context name (display-name) |
protected void |
setInitParameter(HashMap<String,String> parameters)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ServletContextImpl()
| Method Detail |
|---|
protected void initListeners(ArrayList<String> listeners)
ServletContextListener that we are starting.
protected void destroyListeners()
ServletContextListener
public String getContextPath()
getContextPath in interface ServletContextprotected 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 ServletContexturi - Absolute URI of a resource on the serverpublic int getMajorVersion()
getMajorVersion in interface ServletContextpublic int getMinorVersion()
getMinorVersion in interface ServletContextpublic String getMimeType(String file)
null if
the MIME type cannot be determined.
getMimeType in interface ServletContextfile - Filename for which to identify a MIME typepublic Set getResourcePaths(String path)
getResourcePaths in interface ServletContextpath - Collection path
public URL getResource(String path)
throws MalformedURLException
getResource in interface ServletContextpath - 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 ServletContextpath - The path to the desired resource.public RequestDispatcher getRequestDispatcher(String arg0)
getRequestDispatcher in interface ServletContextpublic RequestDispatcher getNamedDispatcher(String arg0)
getNamedDispatcher in interface ServletContextpublic Servlet getServlet(String name)
getServlet in interface ServletContextpublic Enumeration getServlets()
getServlets in interface ServletContextpublic Enumeration getServletNames()
getServletNames in interface ServletContextpublic 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 ServletContextpublic String getRealPath(String path)
null.
getRealPath in interface ServletContextpath - The path to the desired resourcepublic String getServerInfo()
getServerInfo in interface ServletContextpublic String getInitParameter(String name)
null if this parameter does not exist.
getInitParameter in interface ServletContextname - Name of the initialization parameter to retrievepublic Enumeration getInitParameterNames()
getInitParameterNames in interface ServletContextprotected void setInitParameter(HashMap<String,String> parameters)
public Object getAttribute(String name)
null.
getAttribute in interface ServletContextname - Name of the context attribute to returnpublic Enumeration getAttributeNames()
getAttributeNames in interface ServletContext
public void setAttribute(String name,
Object value)
setAttribute in interface ServletContextname - Attribute name to be boundvalue - New attribute value to be boundpublic void removeAttribute(String name)
removeAttribute in interface ServletContextname - Name of the context attribute to be removedpublic String getServletContextName()
getServletContextName in interface ServletContextpublic void setDisplayName(String contextName)
contextName - protected String normalize(String path)
null instead.
path - Path to be normalizedprotected String getBasePath()
protected void setBasePath(String basePath)
getRealPath(java.lang.String).
basePath - protected List<EventListener> getListeners()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||