public class MockServletContext extends Object implements ServletContext
| Constructor and Description |
|---|
MockServletContext() |
| Modifier and Type | Method and Description |
|---|---|
Object |
getAttribute(String name) |
Enumeration |
getAttributeNames() |
ServletContext |
getContext(String uripath) |
String |
getContextPath() |
String |
getInitParameter(String name) |
Enumeration |
getInitParameterNames() |
int |
getMajorVersion() |
String |
getMimeType(String file) |
int |
getMinorVersion() |
RequestDispatcher |
getNamedDispatcher(String name) |
String |
getRealPath(String path) |
RequestDispatcher |
getRequestDispatcher(String path) |
URL |
getResource(String path) |
InputStream |
getResourceAsStream(String path) |
Set |
getResourcePaths(String path) |
String |
getServerInfo() |
Servlet |
getServlet(String name) |
String |
getServletContextName() |
Enumeration |
getServletNames() |
Enumeration |
getServlets() |
void |
log(Exception exception,
String msg) |
void |
log(String msg) |
void |
log(String message,
Throwable throwable) |
void |
removeAttribute(String name) |
void |
setAttribute(String name,
Object object) |
public Object getAttribute(String name)
getAttribute in interface ServletContextpublic Enumeration getAttributeNames()
getAttributeNames in interface ServletContextpublic ServletContext getContext(String uripath)
getContext in interface ServletContextpublic String getContextPath()
getContextPath in interface ServletContextpublic String getInitParameter(String name)
getInitParameter in interface ServletContextpublic Enumeration getInitParameterNames()
getInitParameterNames in interface ServletContextpublic int getMajorVersion()
getMajorVersion in interface ServletContextpublic String getMimeType(String file)
getMimeType in interface ServletContextpublic int getMinorVersion()
getMinorVersion in interface ServletContextpublic RequestDispatcher getNamedDispatcher(String name)
getNamedDispatcher in interface ServletContextpublic String getRealPath(String path)
getRealPath in interface ServletContextpublic RequestDispatcher getRequestDispatcher(String path)
getRequestDispatcher in interface ServletContextpublic URL getResource(String path) throws MalformedURLException
getResource in interface ServletContextMalformedURLExceptionpublic InputStream getResourceAsStream(String path)
getResourceAsStream in interface ServletContextpublic Set getResourcePaths(String path)
getResourcePaths in interface ServletContextpublic String getServerInfo()
getServerInfo in interface ServletContextpublic Servlet getServlet(String name) throws ServletException
getServlet in interface ServletContextServletExceptionpublic String getServletContextName()
getServletContextName in interface ServletContextpublic Enumeration getServletNames()
getServletNames in interface ServletContextpublic Enumeration getServlets()
getServlets 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 void removeAttribute(String name)
removeAttribute in interface ServletContextpublic void setAttribute(String name, Object object)
setAttribute in interface ServletContextCopyright © 2008–2015 The Apache Software Foundation. All rights reserved.