|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tapestry5.internal.services.ResponseImpl
public class ResponseImpl
Implementation of Response that wraps around an underlying HttpServletResponse.
| Constructor Summary | |
|---|---|
ResponseImpl(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
|
| Method Summary | |
|---|---|
void |
disableCompression()
Invoked to indicate that the response content is either already compressed, or is not compressable. |
java.lang.String |
encodeRedirectURL(java.lang.String URL)
Encodes the URL for use as a redirect, ensuring that a session id is included (if a session exists, and as necessary depending on the client browser's use of cookies). |
java.lang.String |
encodeURL(java.lang.String URL)
Encodes the URL, ensuring that a session id is included (if a session exists, and as necessary depending on the client browser's use of cookies). |
java.io.OutputStream |
getOutputStream(java.lang.String contentType)
Returns an OutputStream to which byte-oriented output may be sent. |
java.io.PrintWriter |
getPrintWriter(java.lang.String contentType)
Returns a PrintWriter object to which output may be sent. |
boolean |
isCommitted()
Returns true if the response has already been sent, either as a redirect or as a stream of content. |
void |
sendError(int sc,
java.lang.String message)
Sends an error response to the client using the specified status. |
void |
sendRedirect(Link link)
Sends a redirect to a link. |
void |
sendRedirect(java.lang.String URL)
Sends a redirect to the client. |
void |
setContentLength(int length)
Sets the length of the content body in the response; this method sets the HTTP Content-Length header. |
void |
setDateHeader(java.lang.String name,
long date)
Sets a response header with the given name and date-value. |
void |
setHeader(java.lang.String name,
java.lang.String value)
Sets a response header with the given name and value. |
void |
setIntHeader(java.lang.String name,
int value)
Sets a response header with the given name and integer value. |
void |
setStatus(int sc)
Sets the status code for this response. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ResponseImpl(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
| Method Detail |
|---|
public java.io.PrintWriter getPrintWriter(java.lang.String contentType)
throws java.io.IOException
Response
getPrintWriter in interface ResponsecontentType - the MIME content type for the output, typically "text/html"
java.io.IOExceptionpublic java.lang.String encodeURL(java.lang.String URL)
Response
encodeURL in interface Responsepublic java.lang.String encodeRedirectURL(java.lang.String URL)
Response
encodeRedirectURL in interface Response
public void sendRedirect(java.lang.String URL)
throws java.io.IOException
Response
sendRedirect in interface ResponseURL - full or partial (relative) URL to send to the client
java.io.IOExceptionResponse.encodeRedirectURL(String)
public void sendRedirect(Link link)
throws java.io.IOException
Response
sendRedirect in interface Responselink - link to redirect to.
java.io.IOExceptionpublic void setStatus(int sc)
ResponsesendError method should be used instead.
setStatus in interface Responsesc - the status code
public java.io.OutputStream getOutputStream(java.lang.String contentType)
throws java.io.IOException
Response
getOutputStream in interface ResponsecontentType - the MIME content type for the output, often "application/octet-stream" or "text/plain" or one
of several others
java.io.IOException
public void sendError(int sc,
java.lang.String message)
throws java.io.IOException
Response
sendError in interface Responsesc - the error status codemessage - the descriptive message
java.io.IOException - If an input or output exception occurspublic void setContentLength(int length)
Response
setContentLength in interface Responselength - the length of the content
public void setDateHeader(java.lang.String name,
long date)
Response
setDateHeader in interface Responsename - the name of the header to setdate - the assigned date value
public void setHeader(java.lang.String name,
java.lang.String value)
Response
setHeader in interface Responsename - the name of the header to setvalue - the assigned value
public void setIntHeader(java.lang.String name,
int value)
Response
setIntHeader in interface Responsename - the name of the header to setvalue - the assigned integer valuepublic boolean isCommitted()
Response
isCommitted in interface Responsepublic void disableCompression()
Response
disableCompression in interface Response
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||