|
|||||||||
| 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. |
javax.servlet.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. |
javax.servlet.RequestDispatcher |
getNamedDispatcher(String name)
|
String |
getRealPath(String path)
Return the real path for a given virtual path, if possible; otherwise return null. |
javax.servlet.RequestDispatcher |
getRequestDispatcher(String path)
|
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()
|
javax.servlet.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(List<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. |
protected void |
setDispatcherHelper(DispatcherHelper dispatcherHelper)
|
void |
setDisplayName(String contextName)
Set the Servlet context name (display-name) |
protected void |
setInitParameter(Map<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(List<String> listeners)
ServletContextListener that we are starting.
protected void destroyListeners()
ServletContextListener
public String getContextPath()
getContextPath in interface javax.servlet.ServletContextprotected void setContextPath(String contextPath)
contextPath - public javax.servlet.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 javax.servlet.ServletContexturi - Absolute URI of a resource on the serverpublic int getMajorVersion()
getMajorVersion in interface javax.servlet.ServletContextpublic int getMinorVersion()
getMinorVersion in interface javax.servlet.ServletContextpublic String getMimeType(String file)
null if
the MIME type cannot be determined.
getMimeType in interface javax.servlet.ServletContextfile - Filename for which to identify a MIME typepublic Set getResourcePaths(String path)
getResourcePaths in interface javax.servlet.ServletContextpath - Collection path
public URL getResource(String path)
throws MalformedURLException
getResource in interface javax.servlet.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 javax.servlet.ServletContextpath - The path to the desired resource.public javax.servlet.RequestDispatcher getRequestDispatcher(String path)
getRequestDispatcher in interface javax.servlet.ServletContextpublic javax.servlet.RequestDispatcher getNamedDispatcher(String name)
getNamedDispatcher in interface javax.servlet.ServletContextpublic javax.servlet.Servlet getServlet(String name)
getServlet in interface javax.servlet.ServletContextpublic Enumeration getServlets()
getServlets in interface javax.servlet.ServletContextpublic Enumeration getServletNames()
getServletNames in interface javax.servlet.ServletContextpublic void log(String string)
log in interface javax.servlet.ServletContext
public void log(Exception e,
String msg)
log in interface javax.servlet.ServletContext
public void log(String msg,
Throwable t)
log in interface javax.servlet.ServletContextpublic String getRealPath(String path)
null.
getRealPath in interface javax.servlet.ServletContextpath - The path to the desired resourcepublic String getServerInfo()
getServerInfo in interface javax.servlet.ServletContextpublic String getInitParameter(String name)
null if this parameter does not exist.
getInitParameter in interface javax.servlet.ServletContextname - Name of the initialization parameter to retrievepublic Enumeration getInitParameterNames()
getInitParameterNames in interface javax.servlet.ServletContextprotected void setInitParameter(Map<String,String> parameters)
public Object getAttribute(String name)
null.
getAttribute in interface javax.servlet.ServletContextname - Name of the context attribute to returnpublic Enumeration getAttributeNames()
getAttributeNames in interface javax.servlet.ServletContext
public void setAttribute(String name,
Object value)
setAttribute in interface javax.servlet.ServletContextname - Attribute name to be boundvalue - New attribute value to be boundpublic void removeAttribute(String name)
removeAttribute in interface javax.servlet.ServletContextname - Name of the context attribute to be removedpublic String getServletContextName()
getServletContextName in interface javax.servlet.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 void setDispatcherHelper(DispatcherHelper dispatcherHelper)
protected List<EventListener> getListeners()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||