类 MockPortletRequest
- java.lang.Object
- org.springframework.mock.web.portlet.MockPortletRequest
- 所有已实现的接口:
PortletRequest
public class MockPortletRequest extends Object implements PortletRequest
Mock implementation of thePortletRequest
interface.- 从以下版本开始:
- 2.0
- 作者:
- John A. Lewis, Juergen Hoeller
嵌套类概要
从接口继承的嵌套类/接口 javax.portlet.PortletRequest
PortletRequest.P3PUserInfos
字段概要
从接口继承的字段 javax.portlet.PortletRequest
ACTION_PHASE, ACTION_SCOPE_ID, BASIC_AUTH, CCPP_PROFILE, CLIENT_CERT_AUTH, DIGEST_AUTH, EVENT_PHASE, FORM_AUTH, LIFECYCLE_PHASE, RENDER_HEADERS, RENDER_MARKUP, RENDER_PART, RENDER_PHASE, RESOURCE_PHASE, USER_INFO
构造器概要
构造器 构造器 说明 MockPortletRequest()
Create a new MockPortletRequest with a defaultMockPortalContext
and a defaultMockPortletContext
.MockPortletRequest(PortalContext portalContext, PortletContext portletContext)
Create a new MockPortletRequest.MockPortletRequest(PortletContext portletContext)
Create a new MockPortletRequest with a defaultMockPortalContext
.
方法概要
构造器详细资料
MockPortletRequest
public MockPortletRequest()
Create a new MockPortletRequest with a defaultMockPortalContext
and a defaultMockPortletContext
.
MockPortletRequest
public MockPortletRequest(PortletContext portletContext)
Create a new MockPortletRequest with a defaultMockPortalContext
.- 参数:
portletContext
- the PortletContext that the request runs in- 另请参阅:
MockPortalContext
MockPortletRequest
public MockPortletRequest(PortalContext portalContext, PortletContext portletContext)
Create a new MockPortletRequest.- 参数:
portalContext
- the PortalContext that the request runs inportletContext
- the PortletContext that the request runs in
方法详细资料
getLifecyclePhase
protected String getLifecyclePhase()
Return the Portlet 2.0 lifecycle id for the current phase.
isActive
public boolean isActive()
Return whether this request is still active (that is, not completed yet).
close
public void close()
Mark this request as completed.
checkActive
protected void checkActive() throws IllegalStateException
Check whether this request is still active (that is, not completed yet), throwing an IllegalStateException if not active anymore.
isWindowStateAllowed
public boolean isWindowStateAllowed(WindowState windowState)
- 指定者:
isWindowStateAllowed
在接口中PortletRequest
isPortletModeAllowed
public boolean isPortletModeAllowed(PortletMode portletMode)
- 指定者:
isPortletModeAllowed
在接口中PortletRequest
setPortletMode
public void setPortletMode(PortletMode portletMode)
getPortletMode
public PortletMode getPortletMode()
- 指定者:
getPortletMode
在接口中PortletRequest
setWindowState
public void setWindowState(WindowState windowState)
getWindowState
public WindowState getWindowState()
- 指定者:
getWindowState
在接口中PortletRequest
setPreferences
public void setPreferences(PortletPreferences preferences)
getPreferences
public PortletPreferences getPreferences()
- 指定者:
getPreferences
在接口中PortletRequest
setSession
public void setSession(PortletSession session)
getPortletSession
public PortletSession getPortletSession()
- 指定者:
getPortletSession
在接口中PortletRequest
getPortletSession
public PortletSession getPortletSession(boolean create)
- 指定者:
getPortletSession
在接口中PortletRequest
setProperty
public void setProperty(String key, String value)
Set a single value for the specified property.If there are already one or more values registered for the given property key, they will be replaced.
addProperty
public void addProperty(String key, String value)
Add a single value for the specified property.If there are already one or more values registered for the given property key, the given value will be added to the end of the list.
getProperty
public String getProperty(String key)
- 指定者:
getProperty
在接口中PortletRequest
getProperties
public Enumeration<String> getProperties(String key)
- 指定者:
getProperties
在接口中PortletRequest
getPropertyNames
public Enumeration<String> getPropertyNames()
- 指定者:
getPropertyNames
在接口中PortletRequest
getPortalContext
public PortalContext getPortalContext()
- 指定者:
getPortalContext
在接口中PortletRequest
setAuthType
public void setAuthType(String authType)
getAuthType
public String getAuthType()
- 指定者:
getAuthType
在接口中PortletRequest
setContextPath
public void setContextPath(String contextPath)
getContextPath
public String getContextPath()
- 指定者:
getContextPath
在接口中PortletRequest
setRemoteUser
public void setRemoteUser(String remoteUser)
getRemoteUser
public String getRemoteUser()
- 指定者:
getRemoteUser
在接口中PortletRequest
setUserPrincipal
public void setUserPrincipal(Principal userPrincipal)
getUserPrincipal
public Principal getUserPrincipal()
- 指定者:
getUserPrincipal
在接口中PortletRequest
addUserRole
public void addUserRole(String role)
isUserInRole
public boolean isUserInRole(String role)
- 指定者:
isUserInRole
在接口中PortletRequest
getAttribute
public Object getAttribute(String name)
- 指定者:
getAttribute
在接口中PortletRequest
getAttributeNames
public Enumeration<String> getAttributeNames()
- 指定者:
getAttributeNames
在接口中PortletRequest
setParameters
public void setParameters(Map<String,String[]> parameters)
setParameter
public void setParameter(String key, String value)
setParameter
public void setParameter(String key, String[] values)
addParameter
public void addParameter(String name, String value)
addParameter
public void addParameter(String name, String[] values)
getParameter
public String getParameter(String name)
- 指定者:
getParameter
在接口中PortletRequest
getParameterNames
public Enumeration<String> getParameterNames()
- 指定者:
getParameterNames
在接口中PortletRequest
getParameterValues
public String[] getParameterValues(String name)
- 指定者:
getParameterValues
在接口中PortletRequest
getParameterMap
public Map<String,String[]> getParameterMap()
- 指定者:
getParameterMap
在接口中PortletRequest
setSecure
public void setSecure(boolean secure)
isSecure
public boolean isSecure()
- 指定者:
isSecure
在接口中PortletRequest
setAttribute
public void setAttribute(String name, Object value)
- 指定者:
setAttribute
在接口中PortletRequest
removeAttribute
public void removeAttribute(String name)
- 指定者:
removeAttribute
在接口中PortletRequest
getRequestedSessionId
public String getRequestedSessionId()
- 指定者:
getRequestedSessionId
在接口中PortletRequest
setRequestedSessionIdValid
public void setRequestedSessionIdValid(boolean requestedSessionIdValid)
isRequestedSessionIdValid
public boolean isRequestedSessionIdValid()
- 指定者:
isRequestedSessionIdValid
在接口中PortletRequest
addResponseContentType
public void addResponseContentType(String responseContentType)
addPreferredResponseContentType
public void addPreferredResponseContentType(String responseContentType)
getResponseContentType
public String getResponseContentType()
- 指定者:
getResponseContentType
在接口中PortletRequest
getResponseContentTypes
public Enumeration<String> getResponseContentTypes()
- 指定者:
getResponseContentTypes
在接口中PortletRequest
addPreferredLocale
public void addPreferredLocale(Locale locale)
getLocale
public Locale getLocale()
- 指定者:
getLocale
在接口中PortletRequest
getLocales
public Enumeration<Locale> getLocales()
- 指定者:
getLocales
在接口中PortletRequest
getScheme
public String getScheme()
- 指定者:
getScheme
在接口中PortletRequest
setServerName
public void setServerName(String serverName)
getServerName
public String getServerName()
- 指定者:
getServerName
在接口中PortletRequest
setServerPort
public void setServerPort(int serverPort)
getServerPort
public int getServerPort()
- 指定者:
getServerPort
在接口中PortletRequest
setWindowID
public void setWindowID(String windowID)
getWindowID
public String getWindowID()
- 指定者:
getWindowID
在接口中PortletRequest
setCookies
public void setCookies(Cookie... cookies)
getCookies
public Cookie[] getCookies()
- 指定者:
getCookies
在接口中PortletRequest
getPrivateParameterMap
public Map<String,String[]> getPrivateParameterMap()
- 指定者:
getPrivateParameterMap
在接口中PortletRequest
getPublicParameterMap
public Map<String,String[]> getPublicParameterMap()
- 指定者:
getPublicParameterMap
在接口中PortletRequest
registerPublicParameter
public void registerPublicParameter(String name)