|
||||||||||
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
public class PortletResponseWrapper
Field Summary |
---|
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 | |
---|---|
PortletResponseWrapper(PortletResponse portletResponse)
Creates a ServletResponse adaptor wrapping the given response object. |
Method Summary | |
---|---|
void |
addProperty(String key,
Element element)
Adds an XML DOM element property to the response. |
void |
addProperty(String key,
String value)
Adds a String property to an existing key to be returned to the portal. |
PortletURL |
createActionURL()
|
Element |
createElement(String tagName)
Creates an element of the type specified to be used in the addProperty method. |
PortletURL |
createRenderURL()
|
ResourceURL |
createResourceURL()
|
String |
encodeURL(String path)
Returns the encoded URL of the resource, like servlets, JSPs, images and other static files, at the given path. |
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. |
PortletResponse |
getPortletResponse()
Return the wrapped ServletResponse object. |
void |
setProperty(String key,
String value)
Sets a String property to be returned to the portal. |
void |
setResponse(PortletResponse response)
Sets the response being wrapped. |
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 |
---|
flushBuffer, getBufferSize, getCharacterEncoding, getContentType, getLocale, getOutputStream, getResponse, getWriter, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setContentLength, setContentType, 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.servlet.ServletResponse |
---|
flushBuffer, getBufferSize, getCharacterEncoding, getContentType, getLocale, getOutputStream, getWriter, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setContentLength, setContentType, setLocale |
Constructor Detail |
---|
public PortletResponseWrapper(PortletResponse portletResponse)
IllegalArgumentException
- if the response is null.Method Detail |
---|
public void addProperty(String key, String value)
PortletResponse
This method allows response properties to have multiple values.
Properties can be used by portlets to provide vendor specific information to the portal.
addProperty
in interface PortletResponse
key
- the key of the property to be returned to the portalvalue
- the value of the property to be returned to the portalpublic void setProperty(String key, String value)
PortletResponse
Properties can be used by portlets to provide vendor specific information to the portal.
This method resets all properties previously added with the same key.
setProperty
in interface PortletResponse
key
- the key of the property to be returned to the portalvalue
- the value of the property to be returned to the portalpublic String encodeURL(String path)
PortletResponse
Portlets should encode all resource URLs pointing to resources in the portlet application via this method in order to ensure that they get served via the portal application.
Some portal/portlet-container implementation may require those URLs to contain implementation specific data encoded in it. Because of that, portlets should use this method to create such URLs.
The encodeURL
method may include the session ID and other
portal/portlet-container specific information into the URL. If encoding
is not needed, it returns the URL unchanged.
encodeURL
in interface PortletResponse
encodeURL
in interface javax.servlet.http.HttpServletResponse
encodeURL
in class javax.servlet.http.HttpServletResponseWrapper
path
- the URI path to the resource. This must be either an absolute
URL (e.g.
http://my.co/myportal/mywebap/myfolder/myresource.gif
)
or a full path URI (e.g.
/myportal/mywebap/myfolder/myresource.gif
).
public PortletURL createActionURL()
public PortletURL createRenderURL()
public ResourceURL createResourceURL()
public String getNamespace()
PortletResponse
The namespace value must be constant for the lifetime of the portlet window.
getNamespace
in interface PortletResponse
public PortletResponse getPortletResponse()
public void setResponse(PortletResponse response)
IllegalArgumentException
- if the response is null.public void addProperty(String key, Element element)
PortletResponse
If a DOM element with the provided key already exists the provided element will be stored in addition to the existing element under the same key.
If the element is null
the key is removed from
the response.
Properties can be used by portlets to provide vendor specific information to the portal.
addProperty
in interface PortletResponse
key
- the key of the property to be returned to the portalelement
- the XML DOM element to be added to the responsepublic Element createElement(String tagName) throws DOMException
PortletResponse
addProperty
method.
createElement
in interface PortletResponse
tagName
- name of the element type to instantiate
DOMException
- INVALID_CHARACTER_ERR: Raised if the specified name
contains an illegal character.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |