类 MockPortletContext
- java.lang.Object
- org.springframework.mock.web.portlet.MockPortletContext
- 所有已实现的接口:
PortletContext
public class MockPortletContext extends Object implements PortletContext
Mock implementation of thePortletContext
interface.- 从以下版本开始:
- 2.0
- 作者:
- John A. Lewis, Juergen Hoeller
构造器概要
构造器 构造器 说明 MockPortletContext()
Create a new MockPortletContext with no base path and a DefaultResourceLoader (i.e. the classpath root as WAR root).MockPortletContext(String resourceBasePath)
Create a new MockPortletContext using a DefaultResourceLoader.MockPortletContext(String resourceBasePath, ResourceLoader resourceLoader)
Create a new MockPortletContext.MockPortletContext(ResourceLoader resourceLoader)
Create a new MockPortletContext, using the specified ResourceLoader and no base path.
方法概要
构造器详细资料
MockPortletContext
public MockPortletContext()
Create a new MockPortletContext with no base path and a DefaultResourceLoader (i.e. the classpath root as WAR root).
MockPortletContext
public MockPortletContext(String resourceBasePath)
Create a new MockPortletContext using a DefaultResourceLoader.- 参数:
resourceBasePath
- the WAR root directory (should not end with a slash)- 另请参阅:
DefaultResourceLoader
MockPortletContext
public MockPortletContext(ResourceLoader resourceLoader)
Create a new MockPortletContext, using the specified ResourceLoader and no base path.- 参数:
resourceLoader
- the ResourceLoader to use (or null for the default)
MockPortletContext
public MockPortletContext(String resourceBasePath, ResourceLoader resourceLoader)
Create a new MockPortletContext.- 参数:
resourceBasePath
- the WAR root directory (should not end with a slash)resourceLoader
- the ResourceLoader to use (or null for the default)
方法详细资料
getResourceLocation
protected String getResourceLocation(String path)
Build a full resource location for the given path, prepending the resource base path of this MockPortletContext.- 参数:
path
- the path as specified- 返回:
- the full resource path
getServerInfo
public String getServerInfo()
- 指定者:
getServerInfo
在接口中PortletContext
getRequestDispatcher
public PortletRequestDispatcher getRequestDispatcher(String path)
- 指定者:
getRequestDispatcher
在接口中PortletContext
getNamedDispatcher
public PortletRequestDispatcher getNamedDispatcher(String path)
- 指定者:
getNamedDispatcher
在接口中PortletContext
getResourceAsStream
public InputStream getResourceAsStream(String path)
- 指定者:
getResourceAsStream
在接口中PortletContext
getMajorVersion
public int getMajorVersion()
- 指定者:
getMajorVersion
在接口中PortletContext
getMinorVersion
public int getMinorVersion()
- 指定者:
getMinorVersion
在接口中PortletContext
getMimeType
public String getMimeType(String filePath)
- 指定者:
getMimeType
在接口中PortletContext
getRealPath
public String getRealPath(String path)
- 指定者:
getRealPath
在接口中PortletContext
getResourcePaths
public Set<String> getResourcePaths(String path)
- 指定者:
getResourcePaths
在接口中PortletContext
getResource
public URL getResource(String path) throws MalformedURLException
- 指定者:
getResource
在接口中PortletContext
- 抛出:
MalformedURLException
getAttribute
public Object getAttribute(String name)
- 指定者:
getAttribute
在接口中PortletContext
getAttributeNames
public Enumeration<String> getAttributeNames()
- 指定者:
getAttributeNames
在接口中PortletContext
setAttribute
public void setAttribute(String name, Object value)
- 指定者:
setAttribute
在接口中PortletContext
removeAttribute
public void removeAttribute(String name)
- 指定者:
removeAttribute
在接口中PortletContext
addInitParameter
public void addInitParameter(String name, String value)
getInitParameter
public String getInitParameter(String name)
- 指定者:
getInitParameter
在接口中PortletContext
getInitParameterNames
public Enumeration<String> getInitParameterNames()
- 指定者:
getInitParameterNames
在接口中PortletContext
log
public void log(String message)
- 指定者:
log
在接口中PortletContext
log
public void log(String message, Throwable t)
- 指定者:
log
在接口中PortletContext
setPortletContextName
public void setPortletContextName(String portletContextName)
getPortletContextName
public String getPortletContextName()
- 指定者:
getPortletContextName
在接口中PortletContext
addContainerRuntimeOption
public void addContainerRuntimeOption(String key)
getContainerRuntimeOptions
public Enumeration<String> getContainerRuntimeOptions()
- 指定者:
getContainerRuntimeOptions
在接口中PortletContext