| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PortletRequest
The PortletRequest encapsulates the request sent by the client to the portlet.
Method Summary | |
---|---|
java.lang.Object | getAttribute(java.lang.String name)
Deprecated. Returns the value of the attribute with the given name, or null if no attribute with the given name exists. |
java.util.Enumeration | getAttributeNames()
Deprecated. Returns an enumeration of names of all attributes available to this request. |
Client | getClient()
Deprecated. Returns an object representing the client device that the user connects to the portal with. |
javax.servlet.http.Cookie[] | getCookies()
Deprecated. Returns an array containing all of the Cookie
objects the client sent with this request.
|
PortletData | getData()
Deprecated. Returns the data of the concrete portlet instance |
long | getDateHeader(java.lang.String name)
Deprecated. Returns the value of the specified request header as a long value that represents a
Date object.
|
java.lang.String | getHeader(java.lang.String name)
Deprecated. Returns the value of the specified request header as a String .
|
java.util.Enumeration | getHeaderNames()
Deprecated. Returns an enumeration of all the header names this request contains. |
java.util.Enumeration | getHeaders(java.lang.String name)
Deprecated. Returns all the values of the specified request header as an Enumeration of String objects.
|
javax.servlet.ServletInputStream | getInputStream()
Deprecated. Retrieves the body of the request as binary data using an InputStream. |
int | getIntHeader(java.lang.String name)
Deprecated. Returns the value of the specified request header as an int .
|
java.util.Locale | getLocale()
Deprecated. Returns the locale of the preferred language. |
java.util.Enumeration | getLocales()
Deprecated. Returns an Enumeration of Locale objects
indicating, in decreasing order starting with the preferred locale, the
locales that are acceptable to the client based on the Accept-Language
header.
|
java.lang.String | getMethod()
Deprecated. Returns the HTTP method of this request. |
Portlet.Mode | getMode()
Deprecated. Returns the mode that the portlet is running in. |
java.lang.String | getParameter(java.lang.String name)
Deprecated. Returns the value of the parameter with the given name, or null if no such parameter exists. |
java.util.Map | getParameterMap()
Deprecated. Returns a map of the parameters of this request. |
java.util.Enumeration | getParameterNames()
Deprecated. Returns an enumeration of all parameter names. |
java.lang.String[] | getParameterValues(java.lang.String name)
Deprecated. Returns the values of all parameters with the given name. |
PortletSession | getPortletSession()
Deprecated. Returns the current session for the portlet or, if there is no current portlet session, creates one and returns it. |
PortletSession | getPortletSession(boolean create)
Deprecated. Returns the current session for the portlet or, if there is no current portlet session and the given flag is true, creates one and returns it. |
PortletSettings | getPortletSettings()
Deprecated. Returns the PortletSettings object of the concrete portlet. |
Portlet.Mode | getPreviousMode()
Deprecated. Returns the last mode that is kept for this portlet on the mode stack, or null if no previous mode exists. |
User | getUser()
Deprecated. Returns the user object. |
PortletWindow | getWindow()
Deprecated. Returns the window that the portlet is running in. |
void | invalidateCache()
Deprecated. Invalidates the cache for all window states, markups and locals |
boolean | isSecure()
Deprecated. Returns whether this request was made using a secure channel, such as HTTPS. |
void | removeAttribute(java.lang.String name)
Deprecated. Removes the attribute with the given name. |
void | setAttribute(java.lang.String name,
java.lang.Object value)
Deprecated. Associates an attribute with the given name and value with this request. |
void | setModeModifier(Portlet.ModeModifier modeModifier)
Deprecated. Defines which portlet mode is shown next. |
Method Detail |
---|
Portlet.Mode getMode()
Portlet.Mode getPreviousMode()
Note that the result is not necessarily the last mode that this portlet was running in. For example, if the portlet starts in view mode, changes to edit mode and then goes back to view mode through a return URL or by using PortletMode.ModeModifier.PREVIOUS, then getPreviousMode will return null because the edit mode has already been removed from the stack.
void setModeModifier(Portlet.ModeModifier modeModifier) throws AccessDeniedException
This function may only be used during event processing, in any other case the call has no effect.
java.lang.String getMethod()
javax.servlet.ServletInputStream getInputStream() throws java.io.IOException
java.util.Locale getLocale()
If more than one language is preferred, the locale returned by this method is the one with the highest preference.
java.util.Enumeration getLocales()
Enumeration
of Locale
objects
indicating, in decreasing order starting with the preferred locale, the
locales that are acceptable to the client based on the Accept-Language
header.
If the client request doesn't provide an Accept-Language header,
this method returns an Enumeration
containing one
Locale
, the default locale for the server.
Enumeration
of preferred
Locale
objects for the clientClient getClient()
java.lang.String getParameter(java.lang.String name)
You should only use this method when you are sure the parameter has only one value. If not, use getParameterValues(String)
All parameter retrieval methods check for parameters that are namespaced by the portlet and for paramters that are not namespaced. If both exist, the namespaced parameter values are returned
java.util.Map getParameterMap()
All parameter retrieval methods check for parameters that are namespaced by the portlet and for paramters that are not namespaced. If both exist, the namespaced parameter values are returned
Note that, for historical reasons, the values of the returned map are Strings and not String arrays, altough this is is inconsistent with the behavior defined by javax.servlet.ServletRequest
java.util.Enumeration getParameterNames()
All parameter retrieval methods check for parameters that are namespaced by the portlet and for paramters that are not namespaced.
java.lang.String[] getParameterValues(java.lang.String name)
A request can carry more than one parameter with a certain name. This method returns these parameters in the order of appearance.
All parameter retrieval methods check for parameters that are namespaced by the portlet and for paramters that are not namespaced. If both exist, the namespaced parameter values are returned
Note that, for historical reasons, this method returns an empty String array and not null if the specified parameter is not set, altough this is is inconsistent with the behavior defined by javax.servlet.ServletRequest
void setAttribute(java.lang.String name, java.lang.Object value)
The portlet provider should take care that the the namespace of attribute names is not unnecessarily polluted. It is recommended to prefix all attributes the package and class name of the portlet that makes use of this method.
void removeAttribute(java.lang.String name)
java.lang.Object getAttribute(java.lang.String name)
java.util.Enumeration getAttributeNames()
boolean isSecure()
PortletWindow getWindow()
PortletData getData()
If the portlet is run in CONFIGURE mode, the portlet data is not accessible and this method will return null.
PortletSession getPortletSession()
This method should not be called when no portal session exists, i.e. when no user is logged in and the portlet is viewed on an anonymous page. In this case, the result may be a temporary session and session contents will be lost after the request completes.
PortletSession getPortletSession(boolean create)
If the given flag is false and there is no current session for the portal, this method returns null. If a session exists for the portal, but the portlet has not yet requested a session, a new portlet session will be created.
This method should not be called with an argument value of true when no portal session exists, i.e. when no user is logged in and the portlet is viewed on an anonymous page. In this case, the result may be a temporary session and session contents will be lost after the request completes.
javax.servlet.http.Cookie[] getCookies()
Cookie
objects the client sent with this request.
This method returns null
if no cookies were sent.
null
if the request has no cookiesUser getUser()
If the user has not logged in or does not grant access to the portlet, this method returns null.
PortletSettings getPortletSettings()
long getDateHeader(java.lang.String name)
long
value that represents a
Date
object. Use this method with
headers that contain dates, such as
If-Modified-Since
.
The date is returned as the number of milliseconds since January 1, 1970 GMT. The header name is case insensitive.
If the request did not have a header of the
specified name, this method returns -1. If the header
can't be converted to a date, the method throws
an IllegalArgumentException
.
String
specifying the
name of the header
long
value
representing the date specified
in the header expressed as
the number of milliseconds
since January 1, 1970 GMT,
or -1 if the named header
was not included with the
reqest
java.lang.String getHeader(java.lang.String name)
String
. If the request did not include a header
of the specified name, this method returns null
.
The header name is case insensitive. You can use
this method with any request header.
String
specifying the
header name
String
containing the
value of the requested
header, or null
if the request does not
have a header of that namejava.util.Enumeration getHeaders(java.lang.String name)
Enumeration
of String
objects.
Some headers, such as Accept-Language
can be sent
by clients as several headers each with a different value rather than
sending the header as a comma separated list.
If the request did not include any headers
of the specified name, this method returns an empty
Enumeration
.
The header name is case insensitive. You can use
this method with any request header.
String
specifying the
header name
Enumeration
containing the
values of the requested
header, or null
if the request does not
have any headers of that namejava.util.Enumeration getHeaderNames()
Some portlet containers do not allow do not allow
portlets to access headers using this method, in
which case this method returns null
null
int getIntHeader(java.lang.String name)
int
. If the request does not have a header
of the specified name, this method returns -1. If the
header cannot be converted to an integer, this method
throws a NumberFormatException
.
The header name is case insensitive.
String
specifying the name
of a request header
int
void invalidateCache()
| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |