public class MockServletContext extends Object implements ServletContext
ORDERED_LIBS, TEMPDIR| Constructor and Description |
|---|
MockServletContext() |
public String getContextPath()
getContextPath in interface ServletContextpublic ServletContext getContext(String uripath)
getContext in interface ServletContextpublic int getMajorVersion()
getMajorVersion in interface ServletContextpublic int getMinorVersion()
getMinorVersion in interface ServletContextpublic String getMimeType(String file)
getMimeType in interface ServletContextpublic Set<String> getResourcePaths(String path)
getResourcePaths in interface ServletContextpublic URL getResource(String path) throws MalformedURLException
getResource in interface ServletContextMalformedURLExceptionpublic InputStream getResourceAsStream(String path)
getResourceAsStream in interface ServletContextpublic RequestDispatcher getRequestDispatcher(String path)
getRequestDispatcher in interface ServletContextpublic RequestDispatcher getNamedDispatcher(String name)
getNamedDispatcher in interface ServletContextpublic Servlet getServlet(String name) throws ServletException
getServlet in interface ServletContextServletExceptionpublic Enumeration<Servlet> getServlets()
getServlets in interface ServletContextpublic Enumeration<String> getServletNames()
getServletNames in interface ServletContextpublic void log(String msg)
log in interface ServletContextpublic void log(Exception exception, String msg)
log in interface ServletContextpublic void log(String message, Throwable throwable)
log in interface ServletContextpublic String getRealPath(String path)
getRealPath in interface ServletContextpublic String getServerInfo()
getServerInfo in interface ServletContextpublic String getInitParameter(String name)
getInitParameter in interface ServletContextpublic Enumeration<String> getInitParameterNames()
getInitParameterNames in interface ServletContextpublic boolean setInitParameter(String name, String value)
setInitParameter in interface ServletContextpublic Object getAttribute(String name)
getAttribute in interface ServletContextpublic Enumeration<String> getAttributeNames()
getAttributeNames in interface ServletContextpublic void setAttribute(String name, Object object)
setAttribute in interface ServletContextpublic void removeAttribute(String name)
removeAttribute in interface ServletContextpublic String getServletContextName()
getServletContextName in interface ServletContextpublic ServletRegistration.Dynamic addServlet(String servletName, String className) throws IllegalArgumentException, IllegalStateException
addServlet in interface ServletContextIllegalArgumentExceptionIllegalStateExceptionpublic ServletRegistration.Dynamic addServlet(String servletName, Servlet servlet) throws IllegalArgumentException, IllegalStateException
addServlet in interface ServletContextIllegalArgumentExceptionIllegalStateExceptionpublic ServletRegistration.Dynamic addServlet(String servletName, Class<? extends Servlet> clazz) throws IllegalArgumentException, IllegalStateException
addServlet in interface ServletContextIllegalArgumentExceptionIllegalStateExceptionpublic <T extends Servlet> T createServlet(Class<T> clazz) throws ServletException
createServlet in interface ServletContextServletExceptionpublic ServletRegistration getServletRegistration(String servletName)
getServletRegistration in interface ServletContextpublic Map<String,? extends ServletRegistration> getServletRegistrations()
getServletRegistrations in interface ServletContextpublic FilterRegistration.Dynamic addFilter(String filterName, String className) throws IllegalArgumentException, IllegalStateException
addFilter in interface ServletContextIllegalArgumentExceptionIllegalStateExceptionpublic FilterRegistration.Dynamic addFilter(String filterName, Filter filter) throws IllegalArgumentException, IllegalStateException
addFilter in interface ServletContextIllegalArgumentExceptionIllegalStateExceptionpublic FilterRegistration.Dynamic addFilter(String filterName, Class<? extends Filter> filterClass) throws IllegalArgumentException, IllegalStateException
addFilter in interface ServletContextIllegalArgumentExceptionIllegalStateExceptionpublic <T extends Filter> T createFilter(Class<T> clazz) throws ServletException
createFilter in interface ServletContextServletExceptionpublic FilterRegistration getFilterRegistration(String filterName)
getFilterRegistration in interface ServletContextpublic Map<String,? extends FilterRegistration> getFilterRegistrations()
getFilterRegistrations in interface ServletContextpublic void addListener(Class<? extends EventListener> listenerClass)
addListener in interface ServletContextpublic void addListener(String className)
addListener in interface ServletContextpublic <T extends EventListener> void addListener(T t)
addListener in interface ServletContextpublic <T extends EventListener> T createListener(Class<T> clazz) throws ServletException
createListener in interface ServletContextServletExceptionpublic void declareRoles(String... roleNames)
declareRoles in interface ServletContextpublic SessionCookieConfig getSessionCookieConfig()
getSessionCookieConfig in interface ServletContextpublic void setSessionTrackingModes(Set<SessionTrackingMode> sessionTrackingModes)
setSessionTrackingModes in interface ServletContextpublic Set<SessionTrackingMode> getDefaultSessionTrackingModes()
getDefaultSessionTrackingModes in interface ServletContextpublic int getEffectiveMajorVersion()
throws UnsupportedOperationException
getEffectiveMajorVersion in interface ServletContextUnsupportedOperationExceptionpublic int getEffectiveMinorVersion()
throws UnsupportedOperationException
getEffectiveMinorVersion in interface ServletContextUnsupportedOperationExceptionpublic Set<SessionTrackingMode> getEffectiveSessionTrackingModes()
getEffectiveSessionTrackingModes in interface ServletContextpublic ClassLoader getClassLoader()
getClassLoader in interface ServletContextpublic JspConfigDescriptor getJspConfigDescriptor()
getJspConfigDescriptor in interface ServletContextCopyright © 2008–2017 The Apache Software Foundation. All rights reserved.