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 thePortletContext
interface, 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 Object
getAttribute(String name)
Enumeration<String>
getAttributeNames()
Enumeration<String>
getContainerRuntimeOptions()
String
getInitParameter(String name)
Enumeration<String>
getInitParameterNames()
int
getMajorVersion()
String
getMimeType(String file)
int
getMinorVersion()
PortletRequestDispatcher
getNamedDispatcher(String name)
String
getPortletContextName()
String
getRealPath(String path)
PortletRequestDispatcher
getRequestDispatcher(String path)
URL
getResource(String path)
InputStream
getResourceAsStream(String path)
Set<String>
getResourcePaths(String path)
String
getServerInfo()
ServletContext
getServletContext()
Return the underlying ServletContext that this PortletContext wraps.void
log(String msg)
void
log(String message, Throwable throwable)
void
removeAttribute(String name)
void
setAttribute(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:
getServerInfo
in interfacePortletContext
getRequestDispatcher
public PortletRequestDispatcher getRequestDispatcher(String path)
- Specified by:
getRequestDispatcher
in interfacePortletContext
getNamedDispatcher
public PortletRequestDispatcher getNamedDispatcher(String name)
- Specified by:
getNamedDispatcher
in interfacePortletContext
getResourceAsStream
public InputStream getResourceAsStream(String path)
- Specified by:
getResourceAsStream
in interfacePortletContext
getMajorVersion
public int getMajorVersion()
- Specified by:
getMajorVersion
in interfacePortletContext
getMinorVersion
public int getMinorVersion()
- Specified by:
getMinorVersion
in interfacePortletContext
getMimeType
public String getMimeType(String file)
- Specified by:
getMimeType
in interfacePortletContext
getRealPath
public String getRealPath(String path)
- Specified by:
getRealPath
in interfacePortletContext
getResourcePaths
public Set<String> getResourcePaths(String path)
- Specified by:
getResourcePaths
in interfacePortletContext
getResource
public URL getResource(String path) throws MalformedURLException
- Specified by:
getResource
in interfacePortletContext
- Throws:
MalformedURLException
getAttribute
public Object getAttribute(String name)
- Specified by:
getAttribute
in interfacePortletContext
getAttributeNames
public Enumeration<String> getAttributeNames()
- Specified by:
getAttributeNames
in interfacePortletContext
getInitParameter
public String getInitParameter(String name)
- Specified by:
getInitParameter
in interfacePortletContext
getInitParameterNames
public Enumeration<String> getInitParameterNames()
- Specified by:
getInitParameterNames
in interfacePortletContext
log
public void log(String msg)
- Specified by:
log
in interfacePortletContext
log
public void log(String message, Throwable throwable)
- Specified by:
log
in interfacePortletContext
removeAttribute
public void removeAttribute(String name)
- Specified by:
removeAttribute
in interfacePortletContext
setAttribute
public void setAttribute(String name, Object object)
- Specified by:
setAttribute
in interfacePortletContext
getPortletContextName
public String getPortletContextName()
- Specified by:
getPortletContextName
in interfacePortletContext
getContainerRuntimeOptions
public Enumeration<String> getContainerRuntimeOptions()
- Specified by:
getContainerRuntimeOptions
in interfacePortletContext