|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MimeResponse
The MimeResponse defines the base interface to assist a portlet in returning MIME content.
Field Summary | |
---|---|
static java.lang.String | CACHE_SCOPE
Property to set the cache scope for this response using the setProperty method intended to be used in forwarded or included servlets/JSPs. |
static java.lang.String | ETAG
Property to tell the portlet container the new ETag for this response intended to be used in forwarded or included servlets/JSPs. |
static java.lang.String | EXPIRATION_CACHE
Property to set the expiration time in seconds for this response using the setProperty method intended to be used in forwarded or included servlets/JSPs. |
static java.lang.String | MARKUP_HEAD_ELEMENT
Property intended to be a hint to the portal application that the provided DOM element should be added to the markup head section of the response to the client. |
static java.lang.String | NAMESPACED_RESPONSE
Property intended to be a hint to the portal application that the returned content is completely namespaced. |
static java.lang.String | PRIVATE_SCOPE
Private cache scope, indicating that the cache entry must not be shared across users. |
static java.lang.String | PUBLIC_SCOPE
Public cache scope, indicating that the cache entry can be shared across users. |
static java.lang.String | USE_CACHED_CONTENT
Property to tell the portlet container to use the cached markup for the validation token provided in the request. |
Method Summary | |
---|---|
PortletURL | createActionURL()
Creates a portlet URL targeting the portlet. |
PortletURL | createRenderURL()
Creates a portlet URL targeting the portlet. |
ResourceURL | createResourceURL()
Creates a portlet URL targeting the portlet. |
void | flushBuffer()
Forces any content in the buffer to be written to the underlying output stream. |
int | getBufferSize()
Returns the actual buffer size used for the response. |
CacheControl | getCacheControl()
Returns the cache control object allowing to set specific cache settings valid for the markup returned in this response. |
java.lang.String | getCharacterEncoding()
Returns the name of the charset used for the MIME body sent in this response. |
java.lang.String | getContentType()
Returns the MIME type that can be used to contribute markup to the render response. |
java.util.Locale | getLocale()
Returns the locale assigned to the response. |
java.io.OutputStream | getPortletOutputStream()
Returns a OutputStream suitable for writing binary data in the response. |
java.io.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(java.lang.String type)
Sets the MIME type for the response. |
Methods inherited from interface javax.portlet.PortletResponse |
---|
addProperty, addProperty, addProperty, createElement, encodeURL, getNamespace, setProperty |
Field Detail |
---|
static final java.lang.String EXPIRATION_CACHE
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.
A default can be defined in the portlet deployment descriptor with the expiration-cache tag, otherwise it is 0.
Non-integer values are treated as 0.
The value is "portlet.expiration-cache".
static final java.lang.String CACHE_SCOPE
Predefined cache scopes are: PUBLIC_SCOPE and PRIVATE_SCOPE.
A default can be defined in the portlet deployment descriptor with the cache-scope tag, otherwise it is PRIVATE_SCOPE.
Values that are not either PUBLIC_SCOPE or PRIVATE_SCOPE are treated as PRIVATE_SCOPE.
The value is "portlet.cache-scope".
static final java.lang.String PUBLIC_SCOPE
static final java.lang.String PRIVATE_SCOPE
static final java.lang.String ETAG
This property needs to be set using the setProperty method.
The value is "portlet.ETag ".
static final java.lang.String USE_CACHED_CONTENT
The value is "portlet.use-cached-content ".
static final java.lang.String NAMESPACED_RESPONSE
This property needs to be set using the setProperty method with a non-null value. The value itself is not evaluated.
The value is "X-JAVAX-PORTLET-NAMESPACED-RESPONSE".
static final java.lang.String MARKUP_HEAD_ELEMENT
Support for this property is optional and the portlet can verify if the calling portal supports this property via the MARKUP_HEAD_ELEMENT_SUPPORT property on the PortalContext.
Even if the calling portal support this property delivery of the DOM element to the client cannot be guaranteed, e.g. due to possible security rules of the portal application or elements that conflict with the response of other portlets.
This property needs to be set using the setProperty(String key,org.w3c.dom.Element element) method.
The value is "javax.portlet.markup.head.element".
Method Detail |
---|
java.lang.String getContentType()
If no content type was set previously using the setContentType(java.lang.String) method this method returns null.
void setContentType(java.lang.String type)
Calling setContentType after getWriter or getOutputStream does not change the content type.
java.lang.String getCharacterEncoding()
See RFC 2047 for more information about character encoding and MIME.
java.io.PrintWriter getWriter() throws java.io.IOException
Before calling this method the content type of the render response should be set using the setContentType(java.lang.String) method.
Either this method or getPortletOutputStream() may be called to write the body, not both.
java.util.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.
int getBufferSize()
void flushBuffer() throws java.io.IOException
void resetBuffer()
boolean isCommitted()
void reset()
java.io.OutputStream getPortletOutputStream() throws java.io.IOException
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.
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.
ResourceURL createResourceURL()
If a request is triggered by the PortletURL, it results in a serve resource request of the ResourceServingPortlet interface.
The returned URL can be further extended by adding portlet-specific parameters .
The created URL will per default contain the current cacheability setting of the parent resource. If no parent resource is available, PAGE is the default.
CacheControl getCacheControl()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |