|
Portlet API 2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The PortletRequest
encapsulates the request sent by the
client to the portlet.
PortletResponse
Method Summary | |
Object |
getAttribute(String name)
Returns the value of the attribute with the given name, or null if no attribute with the given name exists. |
Enumeration |
getAttributeNames()
Returns an enumeration of names of all attributes available to this request. |
Client |
getClient()
Returns an object representing the client device that the user connects to the portal with. |
Locale |
getLocale()
Returns the locale of the preferred language. |
Enumeration |
getLocales()
Returns an enumeration of locales indicating, in decreasing order starting with the locale of the preferred languages, the preferred languages. |
String |
getMethod()
Returns the HTTP method of this request. |
Portlet.Mode |
getMode()
Returns the mode that the portlet is running in. |
PortletPage |
getPage()
Returns the page that the portlet is part of. |
String |
getParameter(String name)
Returns the value of the parameter with the given name, or null if no such parameter exists. |
Map |
getParameterMap()
Returns a map of the parameters of this request. |
Enumeration |
getParameterNames()
Returns an enumeration of all parameter names. |
String[] |
getParameterValues(String name)
Returns the values of all parameters with the given name. |
PortletSession |
getSession()
Returns the current session or, if there is no current session, it creates one and returns it. |
PortletSession |
getSession(boolean create)
Returns the current session or, if there is no current session and the given flag is true , it creates one and returns
it. |
PortletWindow |
getWindow()
Returns the window that the portlet is running in. |
boolean |
isSecure()
Returns whether this request was made using a secure channel, such as HTTPS. |
void |
setAttribute(String name,
Object value)
Associates an attribute with the given name and value with this request. |
Method Detail |
public Portlet.Mode getMode()
public String getMethod()
public Locale getLocale()
If more than one language is preferred, the locale returned by this method is the one with the highest preference.
getLocales()
public Enumeration getLocales()
getLocale()
public Client getClient()
public String getParameter(String name)
null
if no such parameter exists.
You should only use this method when you are sure the
parameter has only one value. If not, use
getParameterValues(String)
name
- the parameter namegetParameterMap()
,
getParameterValues(String)
public Map getParameterMap()
getParameter(String)
,
getParameterValues(String)
public Enumeration getParameterNames()
public String[] getParameterValues(String name)
A request can carry more than one parameter with a certain name. This method returns these parameters in the order of appearance.
name
- the parameter namegetParameterMap()
,
getParameter(String)
public void setAttribute(String name, 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. The prefixing should probably be done by the portlet container.
name
- the attribute namevalue
- the attribute valuepublic Object getAttribute(String name)
null
if no attribute with the given name exists.name
- the attribute namepublic Enumeration getAttributeNames()
public boolean isSecure()
true
if channel is secure, false
otherwisepublic PortletWindow getWindow()
public PortletPage getPage()
public PortletSession getSession()
public PortletSession getSession(boolean create)
true
, it creates one and returns
it.
If the given flag is false
and there is no current
portlet session, this method returns null
.
create
- true
to create a news session, false
to return null
of there
is no current session
|
Portlet API 2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |