|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.ServletResponseWrapper
javax.servlet.http.HttpServletResponseWrapper
org.apache.pluto.wrappers.PortletResponseWrapper
org.apache.pluto.wrappers.RenderResponseWrapper
public class RenderResponseWrapper
| Field Summary |
|---|
| Fields inherited from interface javax.portlet.MimeResponse |
|---|
CACHE_SCOPE, ETAG, EXPIRATION_CACHE, MARKUP_HEAD_ELEMENT, NAMESPACED_RESPONSE, PRIVATE_SCOPE, PUBLIC_SCOPE, USE_CACHED_CONTENT |
| Fields inherited from interface javax.servlet.http.HttpServletResponse |
|---|
SC_ACCEPTED, SC_BAD_GATEWAY, SC_BAD_REQUEST, SC_CONFLICT, SC_CONTINUE, SC_CREATED, SC_EXPECTATION_FAILED, SC_FORBIDDEN, SC_FOUND, SC_GATEWAY_TIMEOUT, SC_GONE, SC_HTTP_VERSION_NOT_SUPPORTED, SC_INTERNAL_SERVER_ERROR, SC_LENGTH_REQUIRED, SC_METHOD_NOT_ALLOWED, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_MULTIPLE_CHOICES, SC_NO_CONTENT, SC_NON_AUTHORITATIVE_INFORMATION, SC_NOT_ACCEPTABLE, SC_NOT_FOUND, SC_NOT_IMPLEMENTED, SC_NOT_MODIFIED, SC_OK, SC_PARTIAL_CONTENT, SC_PAYMENT_REQUIRED, SC_PRECONDITION_FAILED, SC_PROXY_AUTHENTICATION_REQUIRED, SC_REQUEST_ENTITY_TOO_LARGE, SC_REQUEST_TIMEOUT, SC_REQUEST_URI_TOO_LONG, SC_REQUESTED_RANGE_NOT_SATISFIABLE, SC_RESET_CONTENT, SC_SEE_OTHER, SC_SERVICE_UNAVAILABLE, SC_SWITCHING_PROTOCOLS, SC_TEMPORARY_REDIRECT, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXY |
| Constructor Summary | |
|---|---|
RenderResponseWrapper(RenderResponse renderResponse)
Creates a ServletResponse adaptor wrapping the given response object. |
|
| Method Summary | |
|---|---|
void |
addProperty(javax.servlet.http.Cookie cookie)
Adds a HTTP Cookie property to the response. The portlet should note that the cookie may not make it to the client, but may be stored at the portal. |
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 underlying output stream. |
int |
getBufferSize()
Returns the actual buffer size used for the response. |
CacheControl |
getCacheControl()
Returns an implementation of JSR-286 CacheContol. |
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.lang.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. |
java.io.OutputStream |
getPortletOutputStream()
Returns a OutputStream suitable for writing binary data in
the response. |
RenderResponse |
getRenderResponse()
Return the wrapped ServletResponse object. |
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 render response. |
void |
setNextPossiblePortletModes(java.util.Collection<PortletMode> portletModes)
This method allows the portlet to tell the portal the next possible portlet modes that the make sense from the portlet point of view. |
void |
setTitle(java.lang.String title)
This method sets the title of the portlet. |
| Methods inherited from class org.apache.pluto.wrappers.PortletResponseWrapper |
|---|
addProperty, addProperty, createElement, createResourceURL, encodeURL, getPortletResponse, setProperty, setResponse |
| Methods inherited from class javax.servlet.http.HttpServletResponseWrapper |
|---|
addCookie, addDateHeader, addHeader, addIntHeader, containsHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, sendError, sendError, sendRedirect, setDateHeader, setHeader, setIntHeader, setStatus, setStatus |
| Methods inherited from class javax.servlet.ServletResponseWrapper |
|---|
getOutputStream, getResponse, setCharacterEncoding, setContentLength, setLocale, setResponse |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.portlet.MimeResponse |
|---|
createResourceURL |
| Methods inherited from interface javax.portlet.PortletResponse |
|---|
addProperty, addProperty, createElement, encodeURL, setProperty |
| Methods inherited from interface javax.servlet.ServletResponse |
|---|
getOutputStream, setCharacterEncoding, setContentLength, setLocale |
| Constructor Detail |
|---|
public RenderResponseWrapper(RenderResponse renderResponse)
java.lang.IllegalArgumentException - if the response is null.| Method Detail |
|---|
public java.lang.String getContentType()
MimeResponse
If no content type was set previously using the MimeResponse.setContentType(java.lang.String)
method this method returns null.
getContentType in interface MimeResponsegetContentType in interface javax.servlet.ServletResponsegetContentType in class javax.servlet.ServletResponseWrappernull if no
content type is setMimeResponse.setContentType(java.lang.String)public PortletURL createRenderURL()
MimeResponseThe 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.
createRenderURL in interface MimeResponsecreateRenderURL in class PortletResponseWrapperpublic PortletURL createActionURL()
MimeResponseThe 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.
createActionURL in interface MimeResponsecreateActionURL in class PortletResponseWrapperpublic java.lang.String getNamespace()
PortletResponseThe namespace value must be constant for the lifetime of the portlet window.
getNamespace in interface PortletResponsegetNamespace in class PortletResponseWrapperpublic void setTitle(java.lang.String title)
RenderResponseThe value can be a text String
setTitle in interface RenderResponsetitle - portlet title as text String or resource URIpublic void setContentType(java.lang.String type)
MimeResponseMimeResponse.getWriter() or
MimeResponse.getPortletOutputStream().
Calling setContentType after getWriter or
getOutputStream does not change the content type.
The portlet container will ignore any character encoding
specified as part of the content type for render
calls.
setContentType in interface MimeResponsesetContentType in interface javax.servlet.ServletResponsesetContentType in class javax.servlet.ServletResponseWrappertype - the content MIME typePortletRequest.getResponseContentTypes(),
MimeResponse.getContentType()public java.lang.String getCharacterEncoding()
MimeResponseSee RFC 2047 for more information about character encoding and MIME.
getCharacterEncoding in interface MimeResponsegetCharacterEncoding in interface javax.servlet.ServletResponsegetCharacterEncoding in class javax.servlet.ServletResponseWrapperString specifying the name of the charset, for
example, ISO-8859-1
public java.io.PrintWriter getWriter()
throws java.io.IOException
MimeResponse
Before calling this method the content type of the render response must
be set using the MimeResponse.setContentType(java.lang.String) method.
Either this method or MimeResponse.getPortletOutputStream() may be called to
write the body, not both.
getWriter in interface MimeResponsegetWriter in interface javax.servlet.ServletResponsegetWriter in class javax.servlet.ServletResponseWrapperPrintWriter object that can return character
data to the portal
java.io.IOException - if an input or output exception occurredMimeResponse.setContentType(java.lang.String),
MimeResponse.getPortletOutputStream()public java.util.Locale getLocale()
MimeResponse
getLocale in interface MimeResponsegetLocale in interface javax.servlet.ServletResponsegetLocale in class javax.servlet.ServletResponseWrapperpublic void setBufferSize(int size)
MimeResponse
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.
setBufferSize in interface MimeResponsesetBufferSize in interface javax.servlet.ServletResponsesetBufferSize in class javax.servlet.ServletResponseWrappersize - the preferred buffer sizeMimeResponse.getBufferSize(),
MimeResponse.flushBuffer(),
MimeResponse.isCommitted(),
MimeResponse.reset()public int getBufferSize()
MimeResponse
getBufferSize in interface MimeResponsegetBufferSize in interface javax.servlet.ServletResponsegetBufferSize in class javax.servlet.ServletResponseWrapperMimeResponse.setBufferSize(int),
MimeResponse.flushBuffer(),
MimeResponse.isCommitted(),
MimeResponse.reset()
public void flushBuffer()
throws java.io.IOException
MimeResponse
flushBuffer in interface MimeResponseflushBuffer in interface javax.servlet.ServletResponseflushBuffer in class javax.servlet.ServletResponseWrapperjava.io.IOException - if an error occurred when writing the outputMimeResponse.setBufferSize(int),
MimeResponse.getBufferSize(),
MimeResponse.isCommitted(),
MimeResponse.reset()public void resetBuffer()
MimeResponseIllegalStateException.
resetBuffer in interface MimeResponseresetBuffer in interface javax.servlet.ServletResponseresetBuffer in class javax.servlet.ServletResponseWrapperMimeResponse.setBufferSize(int),
MimeResponse.getBufferSize(),
MimeResponse.isCommitted(),
MimeResponse.reset()public boolean isCommitted()
MimeResponse
isCommitted in interface MimeResponseisCommitted in interface javax.servlet.ServletResponseisCommitted in class javax.servlet.ServletResponseWrapperMimeResponse.setBufferSize(int),
MimeResponse.getBufferSize(),
MimeResponse.flushBuffer(),
MimeResponse.reset()public void reset()
MimeResponseIllegalStateException.
reset in interface MimeResponsereset in interface javax.servlet.ServletResponsereset in class javax.servlet.ServletResponseWrapperMimeResponse.setBufferSize(int),
MimeResponse.getBufferSize(),
MimeResponse.flushBuffer(),
MimeResponse.isCommitted()
public java.io.OutputStream getPortletOutputStream()
throws java.io.IOException
MimeResponseOutputStream 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 MimeResponse.setContentType(java.lang.String) method.
Calling flush() on the OutputStream commits the response.
Either this method or MimeResponse.getWriter() may be called to write the body,
not both.
getPortletOutputStream in interface MimeResponseOutputStream for writing binary data
java.io.IOException - if an input or output exception occurredMimeResponse.setContentType(java.lang.String),
MimeResponse.getWriter()public CacheControl getCacheControl()
CacheContol.
getCacheControl in interface MimeResponsepublic RenderResponse getRenderResponse()
public void addProperty(javax.servlet.http.Cookie cookie)
MimeResponseThis method allows response properties to have multiple cookies.
addProperty in interface MimeResponsecookie - the cookie to be added to the responsepublic void setNextPossiblePortletModes(java.util.Collection<PortletMode> portletModes)
RenderResponseIf set, the portal should honor these enumeration of portlet modes and only provide the end user with choices to the provided portlet modes or a subset of these modes based on access control considerations.
If the portlet does not set any next possible portlet modes the default is that all portlet modes that the portlet has defined supporting in the portlet deployment descriptor are meaningful new portlet modes.
setNextPossiblePortletModes in interface RenderResponseportletModes - Enumeration of PortletMode objects with the
next possible portlet modes that the make sense from the
portlet point of view, must not be null or an
empty enumeration.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||