|
Apache Tomcat 7.0.22 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.jasper.servlet.JspCServletContext
public class JspCServletContext
Simple ServletContext implementation without
HTTP-specific methods.
| Field Summary | |
|---|---|
protected java.util.Hashtable<java.lang.String,java.lang.Object> |
myAttributes
Servlet context attributes. |
protected java.io.PrintWriter |
myLogWriter
The log writer we will write log messages to. |
protected java.net.URL |
myResourceBaseURL
The base URL (document root) for this context. |
| Fields inherited from interface javax.servlet.ServletContext |
|---|
ORDERED_LIBS, TEMPDIR |
| Constructor Summary | |
|---|---|
JspCServletContext(java.io.PrintWriter aLogWriter,
java.net.URL aResourceBaseURL)
Create a new instance of this ServletContext implementation. |
|
| Method Summary | ||
|---|---|---|
FilterRegistration.Dynamic |
addFilter(java.lang.String filterName,
java.lang.Class<? extends Filter> filterClass)
|
|
FilterRegistration.Dynamic |
addFilter(java.lang.String filterName,
Filter filter)
|
|
FilterRegistration.Dynamic |
addFilter(java.lang.String filterName,
java.lang.String className)
|
|
void |
addListener(java.lang.Class<? extends java.util.EventListener> listenerClass)
|
|
void |
addListener(java.lang.String className)
|
|
|
addListener(T t)
|
|
ServletRegistration.Dynamic |
addServlet(java.lang.String servletName,
java.lang.Class<? extends Servlet> servletClass)
|
|
ServletRegistration.Dynamic |
addServlet(java.lang.String servletName,
Servlet servlet)
|
|
ServletRegistration.Dynamic |
addServlet(java.lang.String servletName,
java.lang.String className)
|
|
|
createFilter(java.lang.Class<T> c)
|
|
|
createListener(java.lang.Class<T> c)
|
|
|
createServlet(java.lang.Class<T> c)
|
|
void |
declareRoles(java.lang.String... roleNames)
|
|
java.lang.Object |
getAttribute(java.lang.String name)
Return the specified context attribute, if any. |
|
java.util.Enumeration<java.lang.String> |
getAttributeNames()
Return an enumeration of context attribute names. |
|
java.lang.ClassLoader |
getClassLoader()
|
|
ServletContext |
getContext(java.lang.String uripath)
Return the servlet context for the specified path. |
|
java.lang.String |
getContextPath()
Return the context path. |
|
java.util.Set<SessionTrackingMode> |
getDefaultSessionTrackingModes()
|
|
int |
getEffectiveMajorVersion()
|
|
int |
getEffectiveMinorVersion()
|
|
java.util.Set<SessionTrackingMode> |
getEffectiveSessionTrackingModes()
|
|
FilterRegistration |
getFilterRegistration(java.lang.String filterName)
|
|
java.util.Map<java.lang.String,? extends FilterRegistration> |
getFilterRegistrations()
|
|
java.lang.String |
getInitParameter(java.lang.String name)
Return the specified context initialization parameter. |
|
java.util.Enumeration<java.lang.String> |
getInitParameterNames()
Return an enumeration of the names of context initialization parameters. |
|
JspConfigDescriptor |
getJspConfigDescriptor()
|
|
int |
getMajorVersion()
Return the Servlet API major version number. |
|
java.lang.String |
getMimeType(java.lang.String file)
Return the MIME type for the specified filename. |
|
int |
getMinorVersion()
Return the Servlet API minor version number. |
|
RequestDispatcher |
getNamedDispatcher(java.lang.String name)
Return a request dispatcher for the specified servlet name. |
|
java.lang.String |
getRealPath(java.lang.String path)
Return the real path for the specified context-relative virtual path. |
|
RequestDispatcher |
getRequestDispatcher(java.lang.String path)
Return a request dispatcher for the specified context-relative path. |
|
java.net.URL |
getResource(java.lang.String path)
Return a URL object of a resource that is mapped to the specified context-relative path. |
|
java.io.InputStream |
getResourceAsStream(java.lang.String path)
Return an InputStream allowing access to the resource at the specified context-relative path. |
|
java.util.Set<java.lang.String> |
getResourcePaths(java.lang.String path)
Return the set of resource paths for the "directory" at the specified context path. |
|
java.lang.String |
getServerInfo()
Return descriptive information about this server. |
|
Servlet |
getServlet(java.lang.String name)
Deprecated. This method has been deprecated with no replacement |
|
java.lang.String |
getServletContextName()
Return the name of this servlet context. |
|
java.util.Enumeration<java.lang.String> |
getServletNames()
Deprecated. This method has been deprecated with no replacement |
|
ServletRegistration |
getServletRegistration(java.lang.String servletName)
|
|
java.util.Map<java.lang.String,? extends ServletRegistration> |
getServletRegistrations()
|
|
java.util.Enumeration<Servlet> |
getServlets()
Deprecated. This method has been deprecated with no replacement |
|
SessionCookieConfig |
getSessionCookieConfig()
|
|
void |
log(java.lang.Exception exception,
java.lang.String message)
Deprecated. Use log(String,Throwable) instead |
|
void |
log(java.lang.String message)
Log the specified message. |
|
void |
log(java.lang.String message,
java.lang.Throwable exception)
Log the specified message and exception. |
|
void |
removeAttribute(java.lang.String name)
Remove the specified context attribute. |
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Set or replace the specified context attribute. |
|
boolean |
setInitParameter(java.lang.String name,
java.lang.String value)
|
|
void |
setSessionTrackingModes(java.util.Set<SessionTrackingMode> sessionTrackingModes)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Hashtable<java.lang.String,java.lang.Object> myAttributes
protected java.io.PrintWriter myLogWriter
protected java.net.URL myResourceBaseURL
| Constructor Detail |
|---|
public JspCServletContext(java.io.PrintWriter aLogWriter,
java.net.URL aResourceBaseURL)
aLogWriter - PrintWriter which is used for log() callsaResourceBaseURL - Resource base URL| Method Detail |
|---|
public java.lang.Object getAttribute(java.lang.String name)
getAttribute in interface ServletContextname - Name of the requested attribute
Object containing the value of the attribute, or
null if no attribute exists matching the given nameServletContext.getAttributeNames()public java.util.Enumeration<java.lang.String> getAttributeNames()
getAttributeNames in interface ServletContextEnumeration of attribute namesServletContext.getAttribute(java.lang.String)public ServletContext getContext(java.lang.String uripath)
getContext in interface ServletContexturipath - Server-relative path starting with '/'
ServletContext object that corresponds to the
named URL, or null if either none exists or the container wishes
to restrict this access.RequestDispatcherpublic java.lang.String getContextPath()
getContextPath in interface ServletContextpublic java.lang.String getInitParameter(java.lang.String name)
getInitParameter in interface ServletContextname - Name of the requested parameter
String containing at least the servlet container
name and version numberServletConfig.getInitParameter(java.lang.String)public java.util.Enumeration<java.lang.String> getInitParameterNames()
getInitParameterNames in interface ServletContextEnumeration of String objects
containing the names of the context's initialization parametersServletConfig.getInitParameter(java.lang.String)public int getMajorVersion()
getMajorVersion in interface ServletContextpublic java.lang.String getMimeType(java.lang.String file)
getMimeType in interface ServletContextfile - Filename whose MIME type is requested
String specifying the file's MIME typepublic int getMinorVersion()
getMinorVersion in interface ServletContextpublic RequestDispatcher getNamedDispatcher(java.lang.String name)
getNamedDispatcher in interface ServletContextname - Name of the requested servlet
RequestDispatcher object that acts as a wrapper for
the named servlet, or null if the
ServletContext cannot return a
RequestDispatcherRequestDispatcher,
ServletContext.getContext(java.lang.String),
ServletConfig.getServletName()public java.lang.String getRealPath(java.lang.String path)
getRealPath in interface ServletContextpath - The context-relative virtual path to resolve
String specifying the real path, or null if the
translation cannot be performedpublic RequestDispatcher getRequestDispatcher(java.lang.String path)
getRequestDispatcher in interface ServletContextpath - Context-relative path for which to acquire a dispatcher
RequestDispatcher object that acts as a wrapper for
the resource at the specified path, or null if the
ServletContext cannot return a
RequestDispatcherRequestDispatcher,
ServletContext.getContext(java.lang.String)
public java.net.URL getResource(java.lang.String path)
throws java.net.MalformedURLException
getResource in interface ServletContextpath - Context-relative path of the desired resource
null if
there is no resource at that path
java.net.MalformedURLException - if the resource path is
not properly formedpublic java.io.InputStream getResourceAsStream(java.lang.String path)
getResourceAsStream in interface ServletContextpath - Context-relative path of the desired resource
InputStream returned to the servlet, or
null if no resource exists at the specified pathpublic java.util.Set<java.lang.String> getResourcePaths(java.lang.String path)
getResourcePaths in interface ServletContextpath - Context-relative base path
public java.lang.String getServerInfo()
getServerInfo in interface ServletContextString containing at least the servlet container
name and version number
@Deprecated
public Servlet getServlet(java.lang.String name)
throws ServletException
getServlet in interface ServletContextname - Name of the requested servlet
ServletExceptionpublic java.lang.String getServletContextName()
getServletContextName in interface ServletContext@Deprecated public java.util.Enumeration<java.lang.String> getServletNames()
getServletNames in interface ServletContext@Deprecated public java.util.Enumeration<Servlet> getServlets()
getServlets in interface ServletContextpublic void log(java.lang.String message)
log in interface ServletContextmessage - The message to be logged
@Deprecated
public void log(java.lang.Exception exception,
java.lang.String message)
log in interface ServletContextexception - The exception to be loggedmessage - The message to be logged
public void log(java.lang.String message,
java.lang.Throwable exception)
log in interface ServletContextmessage - The message to be loggedexception - The exception to be loggedpublic void removeAttribute(java.lang.String name)
removeAttribute in interface ServletContextname - Name of the attribute to remove
public void setAttribute(java.lang.String name,
java.lang.Object value)
setAttribute in interface ServletContextname - Name of the context attribute to setvalue - Corresponding attribute value
public FilterRegistration.Dynamic addFilter(java.lang.String filterName,
java.lang.String className)
addFilter in interface ServletContext
public ServletRegistration.Dynamic addServlet(java.lang.String servletName,
java.lang.String className)
addServlet in interface ServletContextpublic java.util.Set<SessionTrackingMode> getDefaultSessionTrackingModes()
getDefaultSessionTrackingModes in interface ServletContextpublic java.util.Set<SessionTrackingMode> getEffectiveSessionTrackingModes()
getEffectiveSessionTrackingModes in interface ServletContextpublic SessionCookieConfig getSessionCookieConfig()
getSessionCookieConfig in interface ServletContextpublic void setSessionTrackingModes(java.util.Set<SessionTrackingMode> sessionTrackingModes)
setSessionTrackingModes in interface ServletContext
public FilterRegistration.Dynamic addFilter(java.lang.String filterName,
Filter filter)
addFilter in interface ServletContext
public FilterRegistration.Dynamic addFilter(java.lang.String filterName,
java.lang.Class<? extends Filter> filterClass)
addFilter in interface ServletContext
public ServletRegistration.Dynamic addServlet(java.lang.String servletName,
Servlet servlet)
addServlet in interface ServletContext
public ServletRegistration.Dynamic addServlet(java.lang.String servletName,
java.lang.Class<? extends Servlet> servletClass)
addServlet in interface ServletContext
public <T extends Filter> T createFilter(java.lang.Class<T> c)
throws ServletException
createFilter in interface ServletContextServletException
public <T extends Servlet> T createServlet(java.lang.Class<T> c)
throws ServletException
createServlet in interface ServletContextServletExceptionpublic FilterRegistration getFilterRegistration(java.lang.String filterName)
getFilterRegistration in interface ServletContextpublic ServletRegistration getServletRegistration(java.lang.String servletName)
getServletRegistration in interface ServletContext
public boolean setInitParameter(java.lang.String name,
java.lang.String value)
setInitParameter in interface ServletContextpublic void addListener(java.lang.Class<? extends java.util.EventListener> listenerClass)
addListener in interface ServletContextpublic void addListener(java.lang.String className)
addListener in interface ServletContextpublic <T extends java.util.EventListener> void addListener(T t)
addListener in interface ServletContext
public <T extends java.util.EventListener> T createListener(java.lang.Class<T> c)
throws ServletException
createListener in interface ServletContextServletExceptionpublic void declareRoles(java.lang.String... roleNames)
declareRoles in interface ServletContextpublic java.lang.ClassLoader getClassLoader()
getClassLoader in interface ServletContextpublic int getEffectiveMajorVersion()
getEffectiveMajorVersion in interface ServletContextpublic int getEffectiveMinorVersion()
getEffectiveMinorVersion in interface ServletContextpublic java.util.Map<java.lang.String,? extends FilterRegistration> getFilterRegistrations()
getFilterRegistrations in interface ServletContextpublic JspConfigDescriptor getJspConfigDescriptor()
getJspConfigDescriptor in interface ServletContextpublic java.util.Map<java.lang.String,? extends ServletRegistration> getServletRegistrations()
getServletRegistrations in interface ServletContext
|
Apache Tomcat 7.0.22 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||