|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vaadin.terminal.gwt.server.WrappedPortletResponse
public class WrappedPortletResponse
Wrapper for PortletResponse
and its subclasses.
WrappedResponse
,
WrappedPortletRequest
,
Serialized FormConstructor Summary | |
---|---|
WrappedPortletResponse(PortletResponse response,
DeploymentConfiguration deploymentConfiguration)
Wraps a portlet response and an associated deployment configuration |
Method Summary | |
---|---|
DeploymentConfiguration |
getDeploymentConfiguration()
Gets the deployment configuration for the context of this response. |
OutputStream |
getOutputStream()
Returns a OutputStream for writing binary data in the
response. |
PortletResponse |
getPortletResponse()
Gets the original, unwrapped portlet response. |
PrintWriter |
getWriter()
Returns a PrintWriter object that can send character text to
the client. |
void |
sendError(int errorCode,
String message)
Sends an error response to the client using the specified status code and clears the buffer. |
void |
setCacheTime(long milliseconds)
Sets cache time in milliseconds, -1 means no cache at all. |
void |
setContentType(String type)
Sets the content type of this response. |
void |
setDateHeader(String name,
long timestamp)
Properly formats a timestamp as a date header. |
void |
setHeader(String name,
String value)
Sets the value of a generic response header. |
void |
setStatus(int responseStatus)
Sets the (http) status code for the response. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WrappedPortletResponse(PortletResponse response, DeploymentConfiguration deploymentConfiguration)
response
- the portlet response to wrapdeploymentConfiguration
- the associated deployment configurationMethod Detail |
---|
public OutputStream getOutputStream() throws IOException
WrappedResponse
OutputStream
for writing binary data in the
response.
Either this method or getWriter() may be called to write the response, not both.
getOutputStream
in interface WrappedResponse
OutputStream
for writing binary data
IOException
- if an input or output exception occurredWrappedResponse.getWriter()
,
ServletResponse.getOutputStream()
,
MimeResponse#getPortletOutputStream()
public PortletResponse getPortletResponse()
public void setContentType(String type)
WrappedResponse
WrappedResponse.getWriter()
is invoked, the returned
PrintWriter will automatically use the defined charset.
setContentType
in interface WrappedResponse
type
- a string specifying the MIME type of the contentServletResponse.setContentType(String)
,
MimeResponse#setContentType(String)
public PrintWriter getWriter() throws IOException
WrappedResponse
PrintWriter
object that can send character text to
the client. The PrintWriter uses the character encoding defined using
setContentType.
Either this method or getOutputStream() may be called to write the response, not both.
getWriter
in interface WrappedResponse
PrintWriter
for writing character text
IOException
- if an input or output exception occurredWrappedResponse.getOutputStream()
,
ServletResponse.getWriter()
,
MimeResponse#getWriter()
public void setStatus(int responseStatus)
WrappedResponse
WrappedResponse.sendError(int, String)
instead.
setStatus
in interface WrappedResponse
responseStatus
- the status code to setHttpServletResponse.setStatus(int)
,
ResourceResponse#HTTP_STATUS_CODE
public void setHeader(String name, String value)
WrappedResponse
setHeader
in interface WrappedResponse
name
- the name of the headervalue
- the header value.HttpServletResponse.setHeader(String, String)
,
PortletResponse#setProperty(String, String)
public void setDateHeader(String name, long timestamp)
WrappedResponse
setDateHeader
in interface WrappedResponse
name
- the name of the headertimestamp
- the number of milliseconds since epochHttpServletResponse.setDateHeader(String, long)
public void setCacheTime(long milliseconds)
WrappedResponse
setCacheTime
in interface WrappedResponse
milliseconds
- Cache time in millisecondspublic void sendError(int errorCode, String message) throws IOException
WrappedResponse
sendError
in interface WrappedResponse
errorCode
- the HTTP status codemessage
- a message to accompany the error
IOException
- if an input or output exception occursHttpServletResponse.sendError(int, String)
public DeploymentConfiguration getDeploymentConfiguration()
WrappedResponse
getDeploymentConfiguration
in interface WrappedResponse
DeploymentConfiguration
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |