Top Description Inners Fields Methods
javax.portlet

public Interface PortletRequest

extends RenderState
Known Direct Subinterfaces
javax.portlet.RenderRequest, javax.portlet.ClientDataRequest, javax.portlet.EventRequest
Known Direct Implementers
javax.portlet.filter.PortletRequestWrapper
Imports
java.util.Locale

The PortletRequest defines the base interface to provide client request information to a portlet. The portlet container uses specialized versions of this interface when invoking a portlet. The portlet container creates these objects and passes them as arguments to the corresponding request processing methods.

The PortletRequest also provides access to the render state.

See Also
RenderState, ActionRequest, EventRequest, RenderRequest, ResourceRequest

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
PortletRequest.P3PUserInfos

P3P user information constants.

Field Summary

Modifier and TypeField and Description
public static final String
ACTION_PHASE

String identifier for the portlet action lifecycle phase.

public static final String
ACTION_SCOPE_ID

The action scope ID that the portlet container uses for storing the current action scope as render parameter if the javax.portlet.actionScopedRequestAttributes container runtime option is used by the portlet.

public static final String
BASIC_AUTH

String identifier for Basic authentication.

public static final String
CCPP_PROFILE

Used to retrieve an instance of the javax.ccpp.Profile with the getAttribute call.

public static final String
CLIENT_CERT_AUTH

String identifier for Certification based authentication.

public static final String
DIGEST_AUTH

String identifier for Digest based authentication.

public static final String
EVENT_PHASE

String identifier for the portlet event lifecycle phase.

public static final String
FORM_AUTH

String identifier for Form based authentication.

public static final String
HEADER_PHASE

String identifier for the portlet render lifecycle phase.
public static final String
LIFECYCLE_PHASE

Provides the portlet lifecycle phase of the current request as request attribute.

public static final String
RENDER_HEADERS

The RENDER_HEADERS is a possible value of the RENDER_PART request attribute and denotes that the portlet should set the intended headers and the portlet title of this render request.

public static final String
RENDER_MARKUP

The RENDER_MARKUP is a possible value of the RENDER_PART request attribute and denotes that the portlet should produce its markup for this render request.

public static final String
RENDER_PART

The RENDER_PART portlet request attribute is set by portals that are streaming based and therefore need to split the render phase into two parts: first the RENDER_HEADERS part where the portlet should only set the header related data and the portlet title, and second the RENDER_MARKUP part in which the portlet should produce its markup.

public static final String
RENDER_PHASE

String identifier for the portlet render lifecycle phase.

public static final String
RESOURCE_PHASE

String identifier for the portlet resource serving lifecycle phase.

public static final String
USER_INFO

Used to retrieve user information attributes with the getAttribute call.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

an Object containing the value of the attribute, or null if the attribute does not exist.
getAttribute
(String
a String specifying the name of the attribute
name
)

Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.

public Enumeration<String>

Returns:

an Enumeration of strings containing the names of the request attributes, or an empty Enumeration if the request has no attributes available to it.
getAttributeNames
()

Returns an Enumeration containing the names of the attributes available to this request.

public String

Returns:

one of the static members BASIC_AUTH, FORM_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH (suitable for == comparison) indicating the authentication scheme, a custom one, or null if the request was not authenticated.
getAuthType
()

Returns the name of the authentication scheme used for the connection between client and portal, for example, BASIC_AUTH, CLIENT_CERT_AUTH, a custom one or null if there was no authentication.

public String

Returns:

a String specifying the portion of the request URL that indicates the context of the request
getContextPath
()

Returns the context path which is the path prefix associated with the deployed portlet application.

public Cookie[]

Returns:

array of cookie properties, or null if no cookies exist.
getCookies
()

Returns an array containing all of the Cookie properties.

public Locale

Returns:

the preferred Locale in which the portal will accept content.
getLocale
()

Returns the preferred Locale in which the portal will accept content.

public Enumeration<Locale>

Returns:

an Enumeration of Locales, in decreasing order, in which the portal will accept content for this request
getLocales
()

Returns an Enumeration of Locale objects indicating, in decreasing order starting with the preferred locale in which the portal will accept content for this request.

public String

Returns:

a String representing the single value of the parameter
getParameter
(String
a String specifying the name of the parameter
name
)

Deprecated As of version 3.0. Use getRenderParameters() instead.
Returns the value of a request parameter as a String, or null if the parameter does not exist.
public Map<String, String[]>

Returns:

an immutable Map containing parameter names as keys and parameter values as map values, or an empty Map if no parameters exist. The keys in the parameter map are of type String. The values in the parameter map are of type String array (String[]).
getParameterMap
()

Deprecated As of version 3.0. Use getRenderParameters() instead.
Returns a Map of all public and private parameters of this request.
public Enumeration<String>

Returns:

an Enumeration of String objects, each String containing the name of a request parameter; or an empty Enumeration if the request has no parameters.
getParameterNames
()

Deprecated As of version 3.0. Use getRenderParameters() instead.
Returns an Enumeration of String objects containing the names of the parameters contained in this request.
public String[]

Returns:

an array of String objects containing the parameter values.
getParameterValues
(String
a String containing the name of the parameter the value of which is requested
name
)

Deprecated As of version 3.0. Use getRenderParameters() instead.
Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.
public PortalContext

Returns:

the context of the calling portal
getPortalContext
()

Returns the context of the calling portal.

public PortletContext

Returns:

a PortletContext object, used by the caller to interact with its portlet container
getPortletContext
()

Returns the PortletContext of the portlet application the portlet is in.
public PortletSession

Returns:

the portlet session
getPortletSession
()

Returns the current portlet session or, if there is no current session, creates one and returns the new session.

public PortletSession

Returns:

the portlet session
getPortletSession
(boolean
true to create a new session,
false to return null if there is no current session
create
)

Returns the current portlet session or, if there is no current session and the given flag is true, creates one and returns the new session.

public PortletPreferences

Returns:

the portlet preferences
getPreferences
()

Returns the preferences object associated with the portlet.

public Map<String, String[]>

Returns:

an immutable Map containing private parameter names as keys and private parameter values as map values, or an empty Map if no private parameters exist. The keys in the parameter map are of type String. The values in the parameter map are of type String array (String[]).
getPrivateParameterMap
()

Deprecated As of version 3.0. Use getRenderParameters() instead.
Returns a Map of the private parameters of this request.
public Enumeration<String>

Returns:

a Enumeration containing the values of the requested property. If the request does not have any properties of that name return an empty Enumeration.
getProperties
(String
a String specifying the property name
name
)

Returns all the values of the specified request property as a Enumeration of String objects.

public String

Returns:

a String containing the value of the requested property, or null if the request does not have a property of that name.
getProperty
(String
a String specifying the property name
name
)

Returns the value of the specified request property as a String.

public Enumeration<String>

Returns:

an Enumeration of all the property names sent with this request; if the request has no properties, an empty Enumeration.
getPropertyNames
()

Returns a Enumeration of all the property names this request contains.

public Map<String, String[]>

Returns:

an immutable Map containing public parameter names as keys and public parameter values as map values, or an empty Map if no public parameters exist. The keys in the parameter map are of type String. The values in the parameter map are of type String array (String[]).
getPublicParameterMap
()

Deprecated As of version 3.0. Use getRenderParameters() instead.
Returns a Map of the public parameters of this request.
public String

Returns:

a String specifying the login of the user making this request, or null if the user login is not known.
getRemoteUser
()

Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated.

public String

Returns:

a String specifying the session ID, or null if the request did not specify a session ID
getRequestedSessionId
()

Returns the session ID indicated in the client request.

public String

Returns:

preferred MIME type of the response
getResponseContentType
()

Returns the portal preferred content type for the response.

public Enumeration<String>

Returns:

ordered list of MIME types for the response
getResponseContentTypes
()

Gets a list of content types which the portal accepts for the response.

public String

Returns:

a String containing the name of the scheme used to make this request
getScheme
()

Returns the name of the scheme used to make this request.

public String

Returns:

a String containing the name of the server to which the request was sent
getServerName
()

Returns the host name of the server that received the request.

public int

Returns:

an integer specifying the port number
getServerPort
()

Returns the port number on which this request was received.

public String

Returns:

The user agent string.
getUserAgent
()

Returns the user agent for the request.
public Principal

Returns:

a java.security.Principal containing the name of the user making this request, or null if the user has not been authenticated.
getUserPrincipal
()

Returns a java.security.Principal object containing the name of the current authenticated user.

public String

Returns:

the portlet window ID
getWindowID
()

Returns the portlet window ID. The portlet window ID is unique for this portlet window and is constant for the lifetime of the portlet window.

public boolean

Returns:

true, if it is valid for this portlet in this request to change to the given portlet mode
isPortletModeAllowed
(PortletMode
portlet mode to check
mode
)

Returns true, if the given portlet mode is a valid one to set for this portlet in the context of the current request.

public boolean

Returns:

true if this request has an id for a valid session in the current session context; false otherwise
isRequestedSessionIdValid
()

Checks whether the requested session ID is still valid.

public boolean

Returns:

true, if the request was made using a secure channel.
isSecure
()

Returns a boolean indicating whether this request was made using a secure channel between client and the portal, such as HTTPS.

public boolean

Returns:

a boolean indicating whether the user making this request belongs to a given role; false if the user has not been authenticated.
isUserInRole
(String
a String specifying the name of the role
role
)

Returns a boolean indicating whether the authenticated user is included in the specified logical "role".

public boolean

Returns:

true, if it is valid for this portlet in this request to change to the given window state
isWindowStateAllowed
(WindowState
window state to checked
state
)

Returns true, if the given window state is valid to be set for this portlet in the context of the current request.

public void
removeAttribute(String
a String specifying the name of the attribute to be removed
name
)

Removes an attribute from this request.

public void
setAttribute(String
a String specifying the name of the attribute
name
,
Object
the Object to be stored
o
)

Stores an attribute in this request.

Inherited from javax.portlet.RenderState:
getPortletModegetRenderParametersgetWindowState