Package org.gatein.pc.api.spi
Interface PortletInvocationContext
-
public interface PortletInvocationContextContract that defines what input/services the caller of a portlet container must provide.- Version:
- $Revision: 5064 $
- Author:
- Julien Viet
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringencodeResourceURL(String url)Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged.org.gatein.common.net.media.MediaTypegetResponseContentType()Returns the response content typevoidrenderURL(Writer writer, ContainerURL containerURL, URLFormat format)Renders a container URL.StringrenderURL(ContainerURL containerURL, URLFormat format)Renders a container URL.
-
-
-
Method Detail
-
getResponseContentType
org.gatein.common.net.media.MediaType getResponseContentType()
Returns the response content type- Returns:
- the response content type
-
encodeResourceURL
String encodeResourceURL(String url) throws IllegalArgumentException
Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged. The implementation of this method includes the logic to determine whether the session ID needs to be encoded in the URL. For example, if the browser supports cookies, or session tracking is turned off, URL encoding is unnecessary.
For robust session tracking, all URLs emitted by a servlet should be run through this method. Otherwise, URL rewriting cannot be used with browsers which do not support cookies.
- Parameters:
url- the url to be encoded- Returns:
- the encoded URL if encoding is needed, the unchanged URL otherwise
- Throws:
IllegalArgumentException- if the url is not valid or null
-
renderURL
String renderURL(ContainerURL containerURL, URLFormat format)
Renders a container URL.- Parameters:
containerURL- the portlet urlformat- the url format- Returns:
- the rendered url
-
renderURL
void renderURL(Writer writer, ContainerURL containerURL, URLFormat format) throws IOException
Renders a container URL.- Parameters:
writer- the writercontainerURL- the portlet urlformat- the url format- Throws:
IOException- any IOException thrown by the writer
-
-