Package javax.portlet

Interface RenderResponse

  • All Superinterfaces:
    PortletResponse

    public interface RenderResponse
    extends PortletResponse
    The RenderResponse defines an object to assist a portlet in sending a response to the portal. It extends the PortletResponse interface to provide specific render response functionality to portlets.
    The portlet container creates a RenderResponse object and passes it as argument to the portlet's render method.
    Version:
    $Revision: 5441 $
    Author:
    Julien Viet
    See Also:
    RenderRequest, PortletResponse
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String EXPIRATION_CACHE
      Property to set the expiration time in seconds for this response using the setProperty method.
    • Field Detail

      • EXPIRATION_CACHE

        static final String EXPIRATION_CACHE
        Property to set the expiration time in seconds for this response using the setProperty method. If the expiration value is set to 0, caching is disabled for this portlet; if the value is set to -1, the cache does not expire. The value is "portlet.expiration-cache".
        See Also:
        Constant Field Values
    • Method Detail

      • getContentType

        String getContentType()
        Returns the MIME type that can be used to contribute markup to the render response. If no content type was set previously using the setContentType(java.lang.String) method this method retuns null.
        Returns:
        the MIME type of the response, or null if no content type is set
        See Also:
        setContentType(java.lang.String)
      • createRenderURL

        PortletURL createRenderURL()
        Creates a portlet URL targeting the portlet. If no portlet mode, window state or security modifier is set in the PortletURL the current values are preserved. If a request is triggered by the PortletURL, it results in a render request. The returned URL can be further extended by adding portlet-specific parameters and portlet modes and window states. The created URL will per default not contain any parameters of the current render request.
        Returns:
        a portlet render URL
      • createActionURL

        PortletURL createActionURL()
        Creates a portlet URL targeting the portlet. If no portlet mode, window state or security modifier is set in the PortletURL the current values are preserved. If a request is triggered by the PortletURL, it results in an action request. The returned URL can be further extended by adding portlet-specific parameters and portlet modes and window states. The created URL will per default not contain any parameters of the current render request.
        Returns:
        a portlet action URL
      • getNamespace

        String getNamespace()
        The value returned by this method should be prefixed or appended to elements, such as JavaScript variables or function names, to ensure they are unique in the context of the portal page.
        Returns:
        the namespace
      • setTitle

        void setTitle​(String title)
        This method sets the title of the portlet. The value can be a text String
        Parameters:
        title - portlet title as text String or resource URI
      • getCharacterEncoding

        String getCharacterEncoding()
        Returns the name of the charset used for the MIME body sent in this response.

        See RFC 2047 for more information about character encoding and MIME.

        Returns:
        a String specifying the name of the charset, for example, ISO-8859-1
      • getLocale

        Locale getLocale()
        Returns the locale assigned to the response.
        Returns:
        Locale of this response
      • setBufferSize

        void setBufferSize​(int size)
                    throws IllegalStateException
        Sets the preferred buffer size for the body of the response. The portlet container will use a buffer at least as large as the size requested. This method must be called before any response body content is written; if content has been written, or the portlet container does not support buffering, this method may throw an IllegalStateException.
        Parameters:
        size - the preferred buffer size
        Throws:
        IllegalStateException - if this method is called after content has been written, or the portlet container does not support buffering
        See Also:
        getBufferSize(), flushBuffer(), isCommitted(), reset()
      • getPortletOutputStream

        OutputStream getPortletOutputStream()
                                     throws IllegalStateException,
                                            IOException
        Returns a OutputStream suitable for writing binary data in the response. The portlet container does not encode the binary data. Before calling this method the content type of the render response must be set using the setContentType(java.lang.String) method. Calling flush() on the OutputStream commits the response. Either this method or getWriter() may be called to write the body, not both.
        Returns:
        a OutputStream for writing binary data
        Throws:
        IllegalStateException - if the getWriter method has been called on this response, or if no content type was set using the setContentType method.
        IOException - if an input or output exception occurred
        See Also:
        setContentType(java.lang.String), getWriter()