|
Copyright © 2008 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RenderResponse
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.
RenderRequest
,
PortletResponse
Field Summary | |
---|---|
static String |
EXPIRATION_CACHE
Property to set the expiration time in seconds for this response using the setProperty method. |
Method Summary | |
---|---|
PortletURL |
createActionURL()
Creates a portlet URL targeting the portlet. |
PortletURL |
createRenderURL()
Creates a portlet URL targeting the portlet. |
void |
flushBuffer()
Forces any content in the buffer to be written to the client. |
int |
getBufferSize()
Returns the actual buffer size used for the response. |
String |
getCharacterEncoding()
Returns the name of the charset used for the MIME body sent in this response. |
String |
getContentType()
Returns the MIME type that can be used to contribute markup to the render response. |
Locale |
getLocale()
Returns the locale assigned to the response. |
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. |
OutputStream |
getPortletOutputStream()
Returns a OutputStream suitable for writing binary
data in the response. |
PrintWriter |
getWriter()
Returns a PrintWriter object that can send character text to the portal. |
boolean |
isCommitted()
Returns a boolean indicating if the response has been committed. |
void |
reset()
Clears any data that exists in the buffer as well as the properties set. |
void |
resetBuffer()
Clears the content of the underlying buffer in the response without clearing properties set. |
void |
setBufferSize(int size)
Sets the preferred buffer size for the body of the response. |
void |
setContentType(String type)
Sets the MIME type for the render response. |
void |
setTitle(String title)
This method sets the title of the portlet. |
Methods inherited from interface javax.portlet.PortletResponse |
---|
addProperty, encodeURL, setProperty |
Field Detail |
---|
static final String EXPIRATION_CACHE
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"
.
Method Detail |
---|
String getContentType()
If no content type was set previously using the setContentType(java.lang.String)
method
this method retuns null
.
null
if no content type is setsetContentType(java.lang.String)
PortletURL createRenderURL()
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.
PortletURL createActionURL()
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.
String getNamespace()
void setTitle(String title)
The value can be a text String
title
- portlet title as text String or resource URIvoid setContentType(String type)
getWriter()
or
getPortletOutputStream()
.
Calling setContentType
after getWriter
or getOutputStream
does not change the content type.
type
- the content MIME type
IllegalArgumentException
- if the given type is not in the list returned
by PortletRequest.getResponseContentTypes
PortletRequest.getResponseContentTypes()
,
getContentType()
String getCharacterEncoding()
See RFC 2047 for more information about character encoding and MIME.
String
specifying the
name of the charset, for
example, ISO-8859-1
PrintWriter getWriter() throws IOException
Before calling this method the content type of the
render response must be set using the setContentType(java.lang.String)
method.
Either this method or getPortletOutputStream()
may be
called to write the body, not both.
PrintWriter
object that
can return character data to the portal
IOException
- if an input or output exception occurred
IllegalStateException
- if the getPortletOutputStream
method
has been called on this response,
or if no content type was set using the
setContentType
method.setContentType(java.lang.String)
,
getPortletOutputStream()
Locale getLocale()
void setBufferSize(int size)
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
.
size
- the preferred buffer size
IllegalStateException
- if this method is called after
content has been written, or the
portlet container does not support bufferinggetBufferSize()
,
flushBuffer()
,
isCommitted()
,
reset()
int getBufferSize()
setBufferSize(int)
,
flushBuffer()
,
isCommitted()
,
reset()
void flushBuffer() throws IOException
IOException
- if an error occured when writing the outputsetBufferSize(int)
,
getBufferSize()
,
isCommitted()
,
reset()
void resetBuffer()
IllegalStateException
.
IllegalStateException
- if this method is called after
response is comittedsetBufferSize(int)
,
getBufferSize()
,
isCommitted()
,
reset()
boolean isCommitted()
setBufferSize(int)
,
getBufferSize()
,
flushBuffer()
,
reset()
void reset()
IllegalStateException
.
IllegalStateException
- if the response has already been
committedsetBufferSize(int)
,
getBufferSize()
,
flushBuffer()
,
isCommitted()
OutputStream getPortletOutputStream() throws IOException
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.
OutputStream
for writing binary data
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 occurredsetContentType(java.lang.String)
,
getWriter()
|
Copyright © 2008 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |