Class ServletWrappingPortletContext
- java.lang.Object
- org.springframework.mock.web.portlet.ServletWrappingPortletContext
- All Implemented Interfaces:
PortletContext
public class ServletWrappingPortletContext extends Object implements PortletContext
Mock implementation of thePortletContextinterface, wrapping an underlyingServletContext.- Since:
- 3.0
- Author:
- Juergen Hoeller
- See Also:
MockPortletContext
Constructor Summary
Constructors Constructor Description ServletWrappingPortletContext(ServletContext servletContext)Create a new PortletContext wrapping the given ServletContext.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetAttribute(String name)Enumeration<String>getAttributeNames()Enumeration<String>getContainerRuntimeOptions()StringgetInitParameter(String name)Enumeration<String>getInitParameterNames()intgetMajorVersion()StringgetMimeType(String file)intgetMinorVersion()PortletRequestDispatchergetNamedDispatcher(String name)StringgetPortletContextName()StringgetRealPath(String path)PortletRequestDispatchergetRequestDispatcher(String path)URLgetResource(String path)InputStreamgetResourceAsStream(String path)Set<String>getResourcePaths(String path)StringgetServerInfo()ServletContextgetServletContext()Return the underlying ServletContext that this PortletContext wraps.voidlog(String msg)voidlog(String message, Throwable throwable)voidremoveAttribute(String name)voidsetAttribute(String name, Object object)
Constructor Detail
ServletWrappingPortletContext
public ServletWrappingPortletContext(ServletContext servletContext)
Create a new PortletContext wrapping the given ServletContext.- Parameters:
servletContext- the ServletContext to wrap
Method Detail
getServletContext
public final ServletContext getServletContext()
Return the underlying ServletContext that this PortletContext wraps.
getServerInfo
public String getServerInfo()
- Specified by:
getServerInfoin interfacePortletContext
getRequestDispatcher
public PortletRequestDispatcher getRequestDispatcher(String path)
- Specified by:
getRequestDispatcherin interfacePortletContext
getNamedDispatcher
public PortletRequestDispatcher getNamedDispatcher(String name)
- Specified by:
getNamedDispatcherin interfacePortletContext
getResourceAsStream
public InputStream getResourceAsStream(String path)
- Specified by:
getResourceAsStreamin interfacePortletContext
getMajorVersion
public int getMajorVersion()
- Specified by:
getMajorVersionin interfacePortletContext
getMinorVersion
public int getMinorVersion()
- Specified by:
getMinorVersionin interfacePortletContext
getMimeType
public String getMimeType(String file)
- Specified by:
getMimeTypein interfacePortletContext
getRealPath
public String getRealPath(String path)
- Specified by:
getRealPathin interfacePortletContext
getResourcePaths
public Set<String> getResourcePaths(String path)
- Specified by:
getResourcePathsin interfacePortletContext
getResource
public URL getResource(String path) throws MalformedURLException
- Specified by:
getResourcein interfacePortletContext- Throws:
MalformedURLException
getAttribute
public Object getAttribute(String name)
- Specified by:
getAttributein interfacePortletContext
getAttributeNames
public Enumeration<String> getAttributeNames()
- Specified by:
getAttributeNamesin interfacePortletContext
getInitParameter
public String getInitParameter(String name)
- Specified by:
getInitParameterin interfacePortletContext
getInitParameterNames
public Enumeration<String> getInitParameterNames()
- Specified by:
getInitParameterNamesin interfacePortletContext
log
public void log(String msg)
- Specified by:
login interfacePortletContext
log
public void log(String message, Throwable throwable)
- Specified by:
login interfacePortletContext
removeAttribute
public void removeAttribute(String name)
- Specified by:
removeAttributein interfacePortletContext
setAttribute
public void setAttribute(String name, Object object)
- Specified by:
setAttributein interfacePortletContext
getPortletContextName
public String getPortletContextName()
- Specified by:
getPortletContextNamein interfacePortletContext
getContainerRuntimeOptions
public Enumeration<String> getContainerRuntimeOptions()
- Specified by:
getContainerRuntimeOptionsin interfacePortletContext