public class ServletContextImpl extends ServletContextCompat implements ServletContext
ORDERED_LIBS, TEMPDIR| Constructor and Description |
|---|
ServletContextImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAttributeListener(ServletContextAttributeListener listener)
Adds the listener.
|
FilterRegistration.Dynamic |
addFilter(java.lang.String filterName,
java.lang.Class<? extends Filter> filterClass)
Adds a filter using filterClass
|
FilterRegistration.Dynamic |
addFilter(java.lang.String filterName,
Filter filter)
Adds a dynamic filter registration using filter
|
FilterRegistration.Dynamic |
addFilter(java.lang.String filterName,
java.lang.String className)
Adds a dynamic filter registration using className
|
void |
addListener(java.lang.Class<? extends java.util.EventListener> listenerClass) |
void |
addListener(ListenerConfig config) |
void |
addListener(java.lang.String className) |
<T extends java.util.EventListener> |
addListener(T t) |
ServletRegistration.Dynamic |
addServlet(java.lang.String servletName,
java.lang.Class<? extends Servlet> servletClass)
Adds a servlet class to the servlet container.
|
ServletRegistration.Dynamic |
addServlet(java.lang.String servletName,
Servlet servlet)
Adds a servlet to context
|
ServletRegistration.Dynamic |
addServlet(java.lang.String servletName,
java.lang.String className)
Adds a servlet with the given className to context
|
<T extends Filter> |
createFilter(java.lang.Class<T> c)
Create a filter using class
|
<T extends java.util.EventListener> |
createListener(java.lang.Class<T> listenerClass) |
<T extends Servlet> |
createServlet(java.lang.Class<T> c)
Creates a servlet instance using the web-apps injection.
|
void |
declareRoles(java.lang.String... roleNames) |
java.lang.Object |
getAttribute(java.lang.String name)
Returns the named attribute.
|
java.util.Enumeration<java.lang.String> |
getAttributeNames()
Returns an enumeration of the attribute names.
|
Path |
getCauchoPath(java.lang.String name) |
java.lang.ClassLoader |
getClassLoader() |
ServletContext |
getContext(java.lang.String uri)
Returns the servlet context for the name.
|
java.lang.String |
getContextPath()
Gets the servlet context name
|
int |
getEffectiveMajorVersion() |
int |
getEffectiveMinorVersion() |
FilterRegistration |
getFilterRegistration(java.lang.String filterName)
Returns filter registration sing filterName
|
java.util.Map<java.lang.String,? extends FilterRegistration> |
getFilterRegistrations()
Returns filter registrations
|
java.lang.String |
getInitParameter(java.lang.String name)
Gets the init params
|
java.util.Enumeration<java.lang.String> |
getInitParameterNames()
Gets the init params
|
JspConfigDescriptor |
getJspConfigDescriptor() |
int |
getMajorVersion()
Returns the servlet major version
|
java.lang.String |
getMimeType(java.lang.String uri)
Returns the mime type for the name.
|
int |
getMinorVersion()
Returns the servlet minor version
|
RequestDispatcher |
getNamedDispatcher(java.lang.String servletName)
Returns a dispatcher for the named servlet.
|
java.lang.String |
getRealPath(java.lang.String uri)
Maps from a URI to a real path.
|
RequestDispatcher |
getRequestDispatcher(java.lang.String uri)
Returns the dispatcher.
|
java.net.URL |
getResource(java.lang.String name)
Returns a resource for the given uri.
|
java.net.URLConnection |
getResource(java.net.URL url) |
java.io.InputStream |
getResourceAsStream(java.lang.String uripath)
Returns the resource for a uripath as an input stream.
|
java.util.Set<java.lang.String> |
getResourcePaths(java.lang.String prefix)
Returns an enumeration of all the resources.
|
Path |
getRootDirectory() |
java.lang.String |
getServerInfo()
Returns the server information
|
Servlet |
getServlet(java.lang.String name) |
java.lang.String |
getServletContextName()
Gets the servlet context name
|
java.util.Enumeration<java.lang.String> |
getServletNames() |
ServletRegistration |
getServletRegistration(java.lang.String servletName)
Returs servlet registration using servletName
|
java.util.Map<java.lang.String,ServletRegistration> |
getServletRegistrations()
Returns servlet registrations
|
java.util.Enumeration<Servlet> |
getServlets() |
protected boolean |
isActive() |
void |
log(java.lang.Exception e,
java.lang.String msg)
Deprecated.
|
void |
log(java.lang.String message)
Logs a message to the error file.
|
void |
log(java.lang.String message,
java.lang.Throwable e)
Error logging
|
void |
removeAttribute(java.lang.String name)
Removes an attribute from the servlet context.
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets an application attribute.
|
void |
setDisplayName(java.lang.String name)
Sets the servlet context name
|
protected void |
setInitParam(java.lang.String name,
java.lang.String value)
Sets an init param
|
boolean |
setInitParameter(java.lang.String name,
java.lang.String value)
Sets an init param
|
void |
setSessionTrackingModes(java.util.Set<SessionTrackingMode> modes)
The session tracking mode
|
getDefaultSessionTrackingModes, getEffectiveSessionTrackingModes, getSessionCookieConfig, setSessionTrackingModesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDefaultSessionTrackingModes, getEffectiveSessionTrackingModes, getSessionCookieConfigpublic Path getRootDirectory()
public void setDisplayName(java.lang.String name)
public java.lang.String getServletContextName()
getServletContextName in interface ServletContextpublic java.lang.String getContextPath()
getContextPath in interface ServletContextprotected void addAttributeListener(ServletContextAttributeListener listener)
public java.lang.String getServerInfo()
getServerInfo in interface ServletContextpublic int getMajorVersion()
getMajorVersion in interface ServletContextpublic int getEffectiveMajorVersion()
getEffectiveMajorVersion in interface ServletContextpublic int getMinorVersion()
getMinorVersion in interface ServletContextpublic int getEffectiveMinorVersion()
getEffectiveMinorVersion in interface ServletContextpublic boolean setInitParameter(java.lang.String name,
java.lang.String value)
setInitParameter in interface ServletContextprotected void setInitParam(java.lang.String name,
java.lang.String value)
public java.lang.String getInitParameter(java.lang.String name)
getInitParameter in interface ServletContextname - init parameter namepublic java.util.Enumeration<java.lang.String> getInitParameterNames()
getInitParameterNames in interface ServletContextpublic java.lang.Object getAttribute(java.lang.String name)
getAttribute in interface ServletContextname - of the attribute.public java.util.Enumeration<java.lang.String> getAttributeNames()
getAttributeNames in interface ServletContextpublic void setAttribute(java.lang.String name,
java.lang.Object value)
setAttribute in interface ServletContextname - the name of the attributevalue - the value of the attributepublic void removeAttribute(java.lang.String name)
removeAttribute in interface ServletContextname - the name of the attribute to remove.public java.lang.String getRealPath(java.lang.String uri)
getRealPath in interface ServletContexturi - path relative to the application root to be translated.public java.net.URL getResource(java.lang.String name)
throws java.net.MalformedURLException
XXX: jdk 1.1.x doesn't appear to allow creation of private URL streams.
getResource in interface ServletContextname - path relative to the application root.java.net.MalformedURLExceptionpublic java.net.URLConnection getResource(java.net.URL url)
throws java.io.IOException
java.io.IOExceptionpublic Path getCauchoPath(java.lang.String name)
public java.io.InputStream getResourceAsStream(java.lang.String uripath)
getResourceAsStream in interface ServletContexturipath - path relative to the application root.public java.util.Set<java.lang.String> getResourcePaths(java.lang.String prefix)
getResourcePaths in interface ServletContextpublic ServletContext getContext(java.lang.String uri)
getContext in interface ServletContexturi - path relative to the rootpublic java.lang.String getMimeType(java.lang.String uri)
getMimeType in interface ServletContexturi - path relative to the application root.public RequestDispatcher getRequestDispatcher(java.lang.String uri)
getRequestDispatcher in interface ServletContexturi - path relative to the app root (including query string)
for the included file.public RequestDispatcher getNamedDispatcher(java.lang.String servletName)
getNamedDispatcher in interface ServletContextservletName - the servlet name to include or forward to.public final void log(java.lang.String message)
log in interface ServletContextmsg - the message to logpublic final void log(java.lang.Exception e,
java.lang.String msg)
log in interface ServletContextpublic void log(java.lang.String message,
java.lang.Throwable e)
log in interface ServletContextmessage - message to loge - stack trace of the errorpublic Servlet getServlet(java.lang.String name)
getServlet in interface ServletContextpublic java.util.Enumeration<java.lang.String> getServletNames()
getServletNames in interface ServletContextpublic java.util.Enumeration<Servlet> getServlets()
getServlets in interface ServletContextpublic void setSessionTrackingModes(java.util.Set<SessionTrackingMode> modes)
ServletContextsetSessionTrackingModes in interface ServletContextpublic ServletRegistration.Dynamic addServlet(java.lang.String servletName, java.lang.String className)
ServletContextaddServlet in interface ServletContextpublic ServletRegistration.Dynamic addServlet(java.lang.String servletName, Servlet servlet)
ServletContextaddServlet in interface ServletContextpublic ServletRegistration.Dynamic addServlet(java.lang.String servletName, java.lang.Class<? extends Servlet> servletClass)
ServletContextaddServlet in interface ServletContextpublic <T extends Servlet> T createServlet(java.lang.Class<T> c) throws ServletException
ServletContextcreateServlet in interface ServletContextServletExceptionpublic ServletRegistration getServletRegistration(java.lang.String servletName)
ServletContextgetServletRegistration in interface ServletContextpublic java.util.Map<java.lang.String,ServletRegistration> getServletRegistrations()
ServletContextgetServletRegistrations in interface ServletContextpublic FilterRegistration.Dynamic addFilter(java.lang.String filterName, java.lang.String className)
ServletContextaddFilter in interface ServletContextpublic FilterRegistration.Dynamic addFilter(java.lang.String filterName, Filter filter)
ServletContextaddFilter in interface ServletContextpublic FilterRegistration.Dynamic addFilter(java.lang.String filterName, java.lang.Class<? extends Filter> filterClass)
ServletContextaddFilter in interface ServletContextpublic <T extends Filter> T createFilter(java.lang.Class<T> c) throws ServletException
ServletContextcreateFilter in interface ServletContextServletExceptionpublic FilterRegistration getFilterRegistration(java.lang.String filterName)
ServletContextgetFilterRegistration in interface ServletContextpublic java.util.Map<java.lang.String,? extends FilterRegistration> getFilterRegistrations()
getFilterRegistrations in interface ServletContext@Configurable public void addListener(ListenerConfig config) throws java.lang.Exception
java.lang.Exceptionpublic void addListener(java.lang.String className)
addListener in interface ServletContextpublic <T extends java.util.EventListener> void addListener(T t)
addListener in interface ServletContextpublic void addListener(java.lang.Class<? extends java.util.EventListener> listenerClass)
addListener in interface ServletContextpublic JspConfigDescriptor getJspConfigDescriptor()
getJspConfigDescriptor in interface ServletContextpublic java.lang.ClassLoader getClassLoader()
getClassLoader in interface ServletContextpublic void declareRoles(java.lang.String... roleNames)
declareRoles in interface ServletContextprotected boolean isActive()
public <T extends java.util.EventListener> T createListener(java.lang.Class<T> listenerClass)
throws ServletException
createListener in interface ServletContextServletException