Package javax.portlet
Interface PortletResponse
-
- All Known Subinterfaces:
ActionResponse,RenderResponse
public interface PortletResponseThePortletResponsedefines the base interface to assist a portlet in creating and sending a response to the client. The portlet container uses two specialized versions of this interface when invoking a portlet,ActionResponseandRenderResponse. The portlet container creates these objects and passes them as arguments to the portlet'sprocessActionandrendermethods.- Version:
- $Revision: 5441 $
- Author:
- Julien Viet
- See Also:
ActionResponse,RenderResponse
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddProperty(String key, String value)Adds a String property to an existing key to be returned to the portal.StringencodeURL(String path)Returns the encoded URL of the resource, like servlets, JSPs, images and other static files, at the given path.voidsetProperty(String key, String value)Sets a String property to be returned to the portal.
-
-
-
Method Detail
-
addProperty
void addProperty(String key, String value) throws IllegalArgumentException
Adds a String property to an existing key to be returned to the portal. This method allows response properties to have multiple values. Properties can be used by portlets to provide vendor specific information to the portal.- Parameters:
key- the key of the property to be returned to the portalvalue- the value of the property to be returned to the portal- Throws:
IllegalArgumentException- if key isnull.
-
setProperty
void setProperty(String key, String value) throws IllegalArgumentException
Sets a String property to be returned to the portal. Properties can be used by portlets to provide vendor specific information to the portal. This method resets all properties previously added with the same key.- Parameters:
key- the key of the property to be returned to the portalvalue- the value of the property to be returned to the portal- Throws:
IllegalArgumentException- if key isnull.
-
encodeURL
String encodeURL(String path) throws IllegalArgumentException
Returns the encoded URL of the resource, like servlets, JSPs, images and other static files, at the given path. Some portal/portlet-container implementation may require those URLs to contain implementation specific data encoded in it. Because of that, portlets should use this method to create such URLs. TheencodeURLmethod may include the session ID and other portal/portlet-container specific information into the URL. If encoding is not needed, it returns the URL unchanged.- Parameters:
path- the URI path to the resource. This must be either an absolute URL (e.g.http://my.co/myportal/mywebap/myfolder/myresource.gif) or a full path URI (e.g./myportal/mywebap/myfolder/myresource.gif).- Returns:
- the encoded resource URL as string
- Throws:
IllegalArgumentException- if path doesn't have a leading slash or is not an absolute URL
-
-