Package org.javlo.test.servlet
Class TestServletContext
- java.lang.Object
-
- org.javlo.test.servlet.TestServletContext
-
- All Implemented Interfaces:
javax.servlet.ServletContext
public class TestServletContext extends Object implements javax.servlet.ServletContext
-
-
Constructor Summary
Constructors Constructor Description TestServletContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.servlet.FilterRegistration.Dynamic
addFilter(String filterName, Class<? extends javax.servlet.Filter> filterClass)
javax.servlet.FilterRegistration.Dynamic
addFilter(String filterName, String className)
javax.servlet.FilterRegistration.Dynamic
addFilter(String filterName, javax.servlet.Filter filter)
void
addListener(Class<? extends EventListener> listenerClass)
void
addListener(String className)
<T extends EventListener>
voidaddListener(T t)
javax.servlet.ServletRegistration.Dynamic
addServlet(String servletName, Class<? extends javax.servlet.Servlet> servletClass)
javax.servlet.ServletRegistration.Dynamic
addServlet(String servletName, String className)
javax.servlet.ServletRegistration.Dynamic
addServlet(String servletName, javax.servlet.Servlet servlet)
<T extends javax.servlet.Filter>
TcreateFilter(Class<T> clazz)
<T extends EventListener>
TcreateListener(Class<T> clazz)
<T extends javax.servlet.Servlet>
TcreateServlet(Class<T> clazz)
void
declareRoles(String... roleNames)
Object
getAttribute(String key)
Enumeration
getAttributeNames()
ClassLoader
getClassLoader()
javax.servlet.ServletContext
getContext(String arg0)
String
getContextPath()
Set<javax.servlet.SessionTrackingMode>
getDefaultSessionTrackingModes()
int
getEffectiveMajorVersion()
int
getEffectiveMinorVersion()
Set<javax.servlet.SessionTrackingMode>
getEffectiveSessionTrackingModes()
javax.servlet.FilterRegistration
getFilterRegistration(String filterName)
Map<String,? extends javax.servlet.FilterRegistration>
getFilterRegistrations()
String
getInitParameter(String arg0)
Enumeration
getInitParameterNames()
javax.servlet.descriptor.JspConfigDescriptor
getJspConfigDescriptor()
int
getMajorVersion()
String
getMimeType(String arg0)
int
getMinorVersion()
javax.servlet.RequestDispatcher
getNamedDispatcher(String arg0)
String
getRealPath(String path)
javax.servlet.RequestDispatcher
getRequestDispatcher(String arg0)
URL
getResource(String arg0)
InputStream
getResourceAsStream(String arg0)
Set
getResourcePaths(String arg0)
String
getServerInfo()
javax.servlet.Servlet
getServlet(String arg0)
String
getServletContextName()
Enumeration
getServletNames()
javax.servlet.ServletRegistration
getServletRegistration(String servletName)
Map<String,? extends javax.servlet.ServletRegistration>
getServletRegistrations()
Enumeration
getServlets()
javax.servlet.SessionCookieConfig
getSessionCookieConfig()
String
getVirtualServerName()
void
log(Exception e, String log)
void
log(String log)
void
log(String log, Throwable t)
void
removeAttribute(String key)
void
setAttribute(String key, Object value)
boolean
setInitParameter(String name, String value)
void
setSessionTrackingModes(Set<javax.servlet.SessionTrackingMode> sessionTrackingModes)
-
-
-
Method Detail
-
getAttribute
public Object getAttribute(String key)
- Specified by:
getAttribute
in interfacejavax.servlet.ServletContext
-
getAttributeNames
public Enumeration getAttributeNames()
- Specified by:
getAttributeNames
in interfacejavax.servlet.ServletContext
-
getContext
public javax.servlet.ServletContext getContext(String arg0)
- Specified by:
getContext
in interfacejavax.servlet.ServletContext
-
getContextPath
public String getContextPath()
- Specified by:
getContextPath
in interfacejavax.servlet.ServletContext
-
getInitParameter
public String getInitParameter(String arg0)
- Specified by:
getInitParameter
in interfacejavax.servlet.ServletContext
-
getInitParameterNames
public Enumeration getInitParameterNames()
- Specified by:
getInitParameterNames
in interfacejavax.servlet.ServletContext
-
getMajorVersion
public int getMajorVersion()
- Specified by:
getMajorVersion
in interfacejavax.servlet.ServletContext
-
getMimeType
public String getMimeType(String arg0)
- Specified by:
getMimeType
in interfacejavax.servlet.ServletContext
-
getMinorVersion
public int getMinorVersion()
- Specified by:
getMinorVersion
in interfacejavax.servlet.ServletContext
-
getNamedDispatcher
public javax.servlet.RequestDispatcher getNamedDispatcher(String arg0)
- Specified by:
getNamedDispatcher
in interfacejavax.servlet.ServletContext
-
getRealPath
public String getRealPath(String path)
- Specified by:
getRealPath
in interfacejavax.servlet.ServletContext
-
getRequestDispatcher
public javax.servlet.RequestDispatcher getRequestDispatcher(String arg0)
- Specified by:
getRequestDispatcher
in interfacejavax.servlet.ServletContext
-
getResource
public URL getResource(String arg0) throws MalformedURLException
- Specified by:
getResource
in interfacejavax.servlet.ServletContext
- Throws:
MalformedURLException
-
getResourceAsStream
public InputStream getResourceAsStream(String arg0)
- Specified by:
getResourceAsStream
in interfacejavax.servlet.ServletContext
-
getResourcePaths
public Set getResourcePaths(String arg0)
- Specified by:
getResourcePaths
in interfacejavax.servlet.ServletContext
-
getServerInfo
public String getServerInfo()
- Specified by:
getServerInfo
in interfacejavax.servlet.ServletContext
-
getServlet
public javax.servlet.Servlet getServlet(String arg0) throws javax.servlet.ServletException
- Specified by:
getServlet
in interfacejavax.servlet.ServletContext
- Throws:
javax.servlet.ServletException
-
getServletContextName
public String getServletContextName()
- Specified by:
getServletContextName
in interfacejavax.servlet.ServletContext
-
getServletNames
public Enumeration getServletNames()
- Specified by:
getServletNames
in interfacejavax.servlet.ServletContext
-
getServlets
public Enumeration getServlets()
- Specified by:
getServlets
in interfacejavax.servlet.ServletContext
-
log
public void log(String log)
- Specified by:
log
in interfacejavax.servlet.ServletContext
-
log
public void log(Exception e, String log)
- Specified by:
log
in interfacejavax.servlet.ServletContext
-
log
public void log(String log, Throwable t)
- Specified by:
log
in interfacejavax.servlet.ServletContext
-
removeAttribute
public void removeAttribute(String key)
- Specified by:
removeAttribute
in interfacejavax.servlet.ServletContext
-
setAttribute
public void setAttribute(String key, Object value)
- Specified by:
setAttribute
in interfacejavax.servlet.ServletContext
-
getEffectiveMajorVersion
public int getEffectiveMajorVersion()
- Specified by:
getEffectiveMajorVersion
in interfacejavax.servlet.ServletContext
-
getEffectiveMinorVersion
public int getEffectiveMinorVersion()
- Specified by:
getEffectiveMinorVersion
in interfacejavax.servlet.ServletContext
-
setInitParameter
public boolean setInitParameter(String name, String value)
- Specified by:
setInitParameter
in interfacejavax.servlet.ServletContext
-
addServlet
public javax.servlet.ServletRegistration.Dynamic addServlet(String servletName, String className)
- Specified by:
addServlet
in interfacejavax.servlet.ServletContext
-
addServlet
public javax.servlet.ServletRegistration.Dynamic addServlet(String servletName, javax.servlet.Servlet servlet)
- Specified by:
addServlet
in interfacejavax.servlet.ServletContext
-
addServlet
public javax.servlet.ServletRegistration.Dynamic addServlet(String servletName, Class<? extends javax.servlet.Servlet> servletClass)
- Specified by:
addServlet
in interfacejavax.servlet.ServletContext
-
createServlet
public <T extends javax.servlet.Servlet> T createServlet(Class<T> clazz) throws javax.servlet.ServletException
- Specified by:
createServlet
in interfacejavax.servlet.ServletContext
- Throws:
javax.servlet.ServletException
-
getServletRegistration
public javax.servlet.ServletRegistration getServletRegistration(String servletName)
- Specified by:
getServletRegistration
in interfacejavax.servlet.ServletContext
-
getServletRegistrations
public Map<String,? extends javax.servlet.ServletRegistration> getServletRegistrations()
- Specified by:
getServletRegistrations
in interfacejavax.servlet.ServletContext
-
addFilter
public javax.servlet.FilterRegistration.Dynamic addFilter(String filterName, String className)
- Specified by:
addFilter
in interfacejavax.servlet.ServletContext
-
addFilter
public javax.servlet.FilterRegistration.Dynamic addFilter(String filterName, javax.servlet.Filter filter)
- Specified by:
addFilter
in interfacejavax.servlet.ServletContext
-
addFilter
public javax.servlet.FilterRegistration.Dynamic addFilter(String filterName, Class<? extends javax.servlet.Filter> filterClass)
- Specified by:
addFilter
in interfacejavax.servlet.ServletContext
-
createFilter
public <T extends javax.servlet.Filter> T createFilter(Class<T> clazz) throws javax.servlet.ServletException
- Specified by:
createFilter
in interfacejavax.servlet.ServletContext
- Throws:
javax.servlet.ServletException
-
getFilterRegistration
public javax.servlet.FilterRegistration getFilterRegistration(String filterName)
- Specified by:
getFilterRegistration
in interfacejavax.servlet.ServletContext
-
getFilterRegistrations
public Map<String,? extends javax.servlet.FilterRegistration> getFilterRegistrations()
- Specified by:
getFilterRegistrations
in interfacejavax.servlet.ServletContext
-
getSessionCookieConfig
public javax.servlet.SessionCookieConfig getSessionCookieConfig()
- Specified by:
getSessionCookieConfig
in interfacejavax.servlet.ServletContext
-
setSessionTrackingModes
public void setSessionTrackingModes(Set<javax.servlet.SessionTrackingMode> sessionTrackingModes)
- Specified by:
setSessionTrackingModes
in interfacejavax.servlet.ServletContext
-
getDefaultSessionTrackingModes
public Set<javax.servlet.SessionTrackingMode> getDefaultSessionTrackingModes()
- Specified by:
getDefaultSessionTrackingModes
in interfacejavax.servlet.ServletContext
-
getEffectiveSessionTrackingModes
public Set<javax.servlet.SessionTrackingMode> getEffectiveSessionTrackingModes()
- Specified by:
getEffectiveSessionTrackingModes
in interfacejavax.servlet.ServletContext
-
addListener
public void addListener(String className)
- Specified by:
addListener
in interfacejavax.servlet.ServletContext
-
addListener
public <T extends EventListener> void addListener(T t)
- Specified by:
addListener
in interfacejavax.servlet.ServletContext
-
addListener
public void addListener(Class<? extends EventListener> listenerClass)
- Specified by:
addListener
in interfacejavax.servlet.ServletContext
-
createListener
public <T extends EventListener> T createListener(Class<T> clazz) throws javax.servlet.ServletException
- Specified by:
createListener
in interfacejavax.servlet.ServletContext
- Throws:
javax.servlet.ServletException
-
getJspConfigDescriptor
public javax.servlet.descriptor.JspConfigDescriptor getJspConfigDescriptor()
- Specified by:
getJspConfigDescriptor
in interfacejavax.servlet.ServletContext
-
getClassLoader
public ClassLoader getClassLoader()
- Specified by:
getClassLoader
in interfacejavax.servlet.ServletContext
-
declareRoles
public void declareRoles(String... roleNames)
- Specified by:
declareRoles
in interfacejavax.servlet.ServletContext
-
getVirtualServerName
public String getVirtualServerName()
- Specified by:
getVirtualServerName
in interfacejavax.servlet.ServletContext
-
-