Package org.eclipse.jetty.server.handler
Class ContextHandler.StaticContext
- java.lang.Object
-
- org.eclipse.jetty.util.AttributesMap
-
- org.eclipse.jetty.server.handler.ContextHandler.StaticContext
-
- All Implemented Interfaces:
ServletContext
,Attributes
,Dumpable
- Direct Known Subclasses:
ContextHandler.Context
- Enclosing class:
- ContextHandler
public static class ContextHandler.StaticContext extends AttributesMap implements ServletContext
A simple implementation of ServletContext that is used when there is no ContextHandler. This is also used as the base for all other ServletContext implementations.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.Attributes
Attributes.Wrapper
-
-
Field Summary
-
Fields inherited from interface javax.servlet.ServletContext
ORDERED_LIBS, TEMPDIR
-
-
Constructor Summary
Constructors Constructor Description StaticContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description FilterRegistration.Dynamic
addFilter(java.lang.String filterName, java.lang.Class<? extends Filter> filterClass)
FilterRegistration.Dynamic
addFilter(java.lang.String filterName, java.lang.String className)
FilterRegistration.Dynamic
addFilter(java.lang.String filterName, Filter filter)
void
addListener(java.lang.Class<? extends java.util.EventListener> listenerClass)
void
addListener(java.lang.String className)
<T extends java.util.EventListener>
voidaddListener(T t)
ServletRegistration.Dynamic
addServlet(java.lang.String servletName, java.lang.Class<? extends Servlet> servletClass)
ServletRegistration.Dynamic
addServlet(java.lang.String servletName, java.lang.String className)
ServletRegistration.Dynamic
addServlet(java.lang.String servletName, Servlet servlet)
<T extends Filter>
TcreateFilter(java.lang.Class<T> clazz)
<T extends java.util.EventListener>
TcreateListener(java.lang.Class<T> clazz)
<T extends Servlet>
TcreateServlet(java.lang.Class<T> clazz)
void
declareRoles(java.lang.String... roleNames)
java.lang.ClassLoader
getClassLoader()
ServletContext
getContext(java.lang.String uripath)
java.lang.String
getContextPath()
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)
java.util.Enumeration<java.lang.String>
getInitParameterNames()
JspConfigDescriptor
getJspConfigDescriptor()
int
getMajorVersion()
java.lang.String
getMimeType(java.lang.String file)
int
getMinorVersion()
RequestDispatcher
getNamedDispatcher(java.lang.String name)
java.lang.String
getRealPath(java.lang.String path)
RequestDispatcher
getRequestDispatcher(java.lang.String uriInContext)
java.net.URL
getResource(java.lang.String path)
java.io.InputStream
getResourceAsStream(java.lang.String path)
java.util.Set<java.lang.String>
getResourcePaths(java.lang.String path)
java.lang.String
getServerInfo()
Servlet
getServlet(java.lang.String name)
Deprecated.java.lang.String
getServletContextName()
java.util.Enumeration<java.lang.String>
getServletNames()
Deprecated.ServletRegistration
getServletRegistration(java.lang.String servletName)
java.util.Map<java.lang.String,? extends ServletRegistration>
getServletRegistrations()
java.util.Enumeration<Servlet>
getServlets()
Deprecated.SessionCookieConfig
getSessionCookieConfig()
java.lang.String
getVirtualServerName()
void
log(java.lang.Exception exception, java.lang.String msg)
void
log(java.lang.String msg)
void
log(java.lang.String message, java.lang.Throwable throwable)
void
setEffectiveMajorVersion(int v)
void
setEffectiveMinorVersion(int v)
boolean
setInitParameter(java.lang.String name, java.lang.String value)
void
setSessionTrackingModes(java.util.Set<SessionTrackingMode> sessionTrackingModes)
-
Methods inherited from class org.eclipse.jetty.util.AttributesMap
addAll, clearAttributes, dump, dump, getAttribute, getAttributeEntrySet, getAttributeNames, getAttributeNamesCopy, getAttributeNameSet, removeAttribute, setAttribute, size, toString
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.servlet.ServletContext
getAttribute, getAttributeNames, removeAttribute, setAttribute
-
-
-
-
Method Detail
-
getContext
public ServletContext getContext(java.lang.String uripath)
- Specified by:
getContext
in interfaceServletContext
-
getMajorVersion
public int getMajorVersion()
- Specified by:
getMajorVersion
in interfaceServletContext
-
getMimeType
public java.lang.String getMimeType(java.lang.String file)
- Specified by:
getMimeType
in interfaceServletContext
-
getMinorVersion
public int getMinorVersion()
- Specified by:
getMinorVersion
in interfaceServletContext
-
getNamedDispatcher
public RequestDispatcher getNamedDispatcher(java.lang.String name)
- Specified by:
getNamedDispatcher
in interfaceServletContext
-
getRequestDispatcher
public RequestDispatcher getRequestDispatcher(java.lang.String uriInContext)
- Specified by:
getRequestDispatcher
in interfaceServletContext
-
getRealPath
public java.lang.String getRealPath(java.lang.String path)
- Specified by:
getRealPath
in interfaceServletContext
-
getResource
public java.net.URL getResource(java.lang.String path) throws java.net.MalformedURLException
- Specified by:
getResource
in interfaceServletContext
- Throws:
java.net.MalformedURLException
-
getResourceAsStream
public java.io.InputStream getResourceAsStream(java.lang.String path)
- Specified by:
getResourceAsStream
in interfaceServletContext
-
getResourcePaths
public java.util.Set<java.lang.String> getResourcePaths(java.lang.String path)
- Specified by:
getResourcePaths
in interfaceServletContext
-
getServerInfo
public java.lang.String getServerInfo()
- Specified by:
getServerInfo
in interfaceServletContext
-
getServlet
@Deprecated public Servlet getServlet(java.lang.String name) throws ServletException
Deprecated.- Specified by:
getServlet
in interfaceServletContext
- Throws:
ServletException
-
getServletNames
@Deprecated public java.util.Enumeration<java.lang.String> getServletNames()
Deprecated.- Specified by:
getServletNames
in interfaceServletContext
-
getServlets
@Deprecated public java.util.Enumeration<Servlet> getServlets()
Deprecated.- Specified by:
getServlets
in interfaceServletContext
-
log
public void log(java.lang.Exception exception, java.lang.String msg)
- Specified by:
log
in interfaceServletContext
-
log
public void log(java.lang.String msg)
- Specified by:
log
in interfaceServletContext
-
log
public void log(java.lang.String message, java.lang.Throwable throwable)
- Specified by:
log
in interfaceServletContext
-
getInitParameter
public java.lang.String getInitParameter(java.lang.String name)
- Specified by:
getInitParameter
in interfaceServletContext
-
getInitParameterNames
public java.util.Enumeration<java.lang.String> getInitParameterNames()
- Specified by:
getInitParameterNames
in interfaceServletContext
-
getServletContextName
public java.lang.String getServletContextName()
- Specified by:
getServletContextName
in interfaceServletContext
-
getContextPath
public java.lang.String getContextPath()
- Specified by:
getContextPath
in interfaceServletContext
-
setInitParameter
public boolean setInitParameter(java.lang.String name, java.lang.String value)
- Specified by:
setInitParameter
in interfaceServletContext
-
addFilter
public FilterRegistration.Dynamic addFilter(java.lang.String filterName, java.lang.Class<? extends Filter> filterClass)
- Specified by:
addFilter
in interfaceServletContext
-
addFilter
public FilterRegistration.Dynamic addFilter(java.lang.String filterName, Filter filter)
- Specified by:
addFilter
in interfaceServletContext
-
addFilter
public FilterRegistration.Dynamic addFilter(java.lang.String filterName, java.lang.String className)
- Specified by:
addFilter
in interfaceServletContext
-
addServlet
public ServletRegistration.Dynamic addServlet(java.lang.String servletName, java.lang.Class<? extends Servlet> servletClass)
- Specified by:
addServlet
in interfaceServletContext
-
addServlet
public ServletRegistration.Dynamic addServlet(java.lang.String servletName, Servlet servlet)
- Specified by:
addServlet
in interfaceServletContext
-
addServlet
public ServletRegistration.Dynamic addServlet(java.lang.String servletName, java.lang.String className)
- Specified by:
addServlet
in interfaceServletContext
-
getDefaultSessionTrackingModes
public java.util.Set<SessionTrackingMode> getDefaultSessionTrackingModes()
- Specified by:
getDefaultSessionTrackingModes
in interfaceServletContext
-
getEffectiveSessionTrackingModes
public java.util.Set<SessionTrackingMode> getEffectiveSessionTrackingModes()
- Specified by:
getEffectiveSessionTrackingModes
in interfaceServletContext
-
getFilterRegistration
public FilterRegistration getFilterRegistration(java.lang.String filterName)
- Specified by:
getFilterRegistration
in interfaceServletContext
-
getFilterRegistrations
public java.util.Map<java.lang.String,? extends FilterRegistration> getFilterRegistrations()
- Specified by:
getFilterRegistrations
in interfaceServletContext
-
getServletRegistration
public ServletRegistration getServletRegistration(java.lang.String servletName)
- Specified by:
getServletRegistration
in interfaceServletContext
-
getServletRegistrations
public java.util.Map<java.lang.String,? extends ServletRegistration> getServletRegistrations()
- Specified by:
getServletRegistrations
in interfaceServletContext
-
getSessionCookieConfig
public SessionCookieConfig getSessionCookieConfig()
- Specified by:
getSessionCookieConfig
in interfaceServletContext
-
setSessionTrackingModes
public void setSessionTrackingModes(java.util.Set<SessionTrackingMode> sessionTrackingModes)
- Specified by:
setSessionTrackingModes
in interfaceServletContext
-
addListener
public void addListener(java.lang.String className)
- Specified by:
addListener
in interfaceServletContext
-
addListener
public <T extends java.util.EventListener> void addListener(T t)
- Specified by:
addListener
in interfaceServletContext
-
addListener
public void addListener(java.lang.Class<? extends java.util.EventListener> listenerClass)
- Specified by:
addListener
in interfaceServletContext
-
createListener
public <T extends java.util.EventListener> T createListener(java.lang.Class<T> clazz) throws ServletException
- Specified by:
createListener
in interfaceServletContext
- Throws:
ServletException
-
createServlet
public <T extends Servlet> T createServlet(java.lang.Class<T> clazz) throws ServletException
- Specified by:
createServlet
in interfaceServletContext
- Throws:
ServletException
-
createFilter
public <T extends Filter> T createFilter(java.lang.Class<T> clazz) throws ServletException
- Specified by:
createFilter
in interfaceServletContext
- Throws:
ServletException
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
- Specified by:
getClassLoader
in interfaceServletContext
-
getEffectiveMajorVersion
public int getEffectiveMajorVersion()
- Specified by:
getEffectiveMajorVersion
in interfaceServletContext
-
getEffectiveMinorVersion
public int getEffectiveMinorVersion()
- Specified by:
getEffectiveMinorVersion
in interfaceServletContext
-
setEffectiveMajorVersion
public void setEffectiveMajorVersion(int v)
-
setEffectiveMinorVersion
public void setEffectiveMinorVersion(int v)
-
getJspConfigDescriptor
public JspConfigDescriptor getJspConfigDescriptor()
- Specified by:
getJspConfigDescriptor
in interfaceServletContext
-
declareRoles
public void declareRoles(java.lang.String... roleNames)
- Specified by:
declareRoles
in interfaceServletContext
-
getVirtualServerName
public java.lang.String getVirtualServerName()
- Specified by:
getVirtualServerName
in interfaceServletContext
-
-