|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tapestry5.internal.test.TestableResponseImpl
public class TestableResponseImpl
| Constructor Summary | |
|---|---|
TestableResponseImpl()
|
|
| Method Summary | |
|---|---|
void |
clear()
Clears internal state, in preparation for the next test. |
void |
disableCompression()
Invoked to indicate that the response content is either already compressed, or is not compressable. |
String |
encodeRedirectURL(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). |
String |
encodeURL(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). |
int |
getContentLength()
|
String |
getContentType()
Returns the the MIME content type for the output. |
String |
getErrorMessage()
Returns the error message, if available. |
Object |
getHeader(String name)
Returns the named header. |
String |
getOutput()
Returns the content of the ServletOutputStream as string. |
OutputStream |
getOutputStream(String contentType)
Returns an OutputStream to which byte-oriented output may be sent. |
PrintWriter |
getPrintWriter(String contentType)
Returns a PrintWriter object to which output may be sent. |
Link |
getRedirectLink()
Returns the link redirected to via Response.sendRedirect(org.apache.tapestry5.Link). |
String |
getRedirectURL()
Returns the redirect URL. |
Document |
getRenderedDocument()
Allows access to the rendered document. |
int |
getStatus()
Returns the status code for this response. |
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,
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(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(String name,
long date)
Sets a response header with the given name and date-value. |
void |
setHeader(String name,
String value)
Sets a response header with the given name and value. |
void |
setIntHeader(String name,
int value)
Sets a response header with the given name and integer value. |
void |
setRenderedDocument(Document document)
Invoked as part of the rendering pipeline to store the final rendered Document object. |
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 TestableResponseImpl()
| Method Detail |
|---|
public OutputStream getOutputStream(String contentType)
throws 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
IOException
public PrintWriter getPrintWriter(String contentType)
throws IOException
Response
getPrintWriter in interface ResponsecontentType - the MIME content type for the output, typically "text/html"
IOException
public void sendError(int sc,
String message)
throws IOException
Response
sendError in interface Responsesc - the error status codemessage - the descriptive message
IOException - If an input or output exception occurs
public void sendRedirect(String URL)
throws IOException
Response
sendRedirect in interface ResponseURL - full or partial (relative) URL to send to the client
IOExceptionResponse.encodeRedirectURL(String)public void setContentLength(int length)
Response
setContentLength in interface Responselength - the length of the content
public void setDateHeader(String name,
long date)
Response
setDateHeader in interface Responsename - the name of the header to setdate - the assigned date value
public void setHeader(String name,
String value)
Response
setHeader in interface Responsename - the name of the header to setvalue - the assigned value
public void setIntHeader(String name,
int value)
Response
setIntHeader in interface Responsename - the name of the header to setvalue - the assigned integer value
public void sendRedirect(Link link)
throws IOException
Response
sendRedirect in interface Responselink - link to redirect to.
IOExceptionpublic void setStatus(int sc)
ResponsesendError method should be used instead.
setStatus in interface Responsesc - the status codepublic String encodeRedirectURL(String URL)
Response
encodeRedirectURL in interface Responsepublic String encodeURL(String URL)
Response
encodeURL in interface Responsepublic Link getRedirectLink()
TestableResponseResponse.sendRedirect(org.apache.tapestry5.Link).
getRedirectLink in interface TestableResponsepublic boolean isCommitted()
Response
isCommitted in interface Responsepublic void clear()
TestableResponse
clear in interface TestableResponsepublic Document getRenderedDocument()
TestableResponse
getRenderedDocument in interface TestableResponsepublic void setRenderedDocument(Document document)
TestableResponse
setRenderedDocument in interface TestableResponsepublic void disableCompression()
Response
disableCompression in interface Responsepublic Object getHeader(String name)
TestableResponse
getHeader in interface TestableResponsepublic String getRedirectURL()
TestableResponse
getRedirectURL in interface TestableResponsepublic int getStatus()
TestableResponse
getStatus in interface TestableResponsepublic String getErrorMessage()
TestableResponse
getErrorMessage in interface TestableResponsepublic int getContentLength()
public String getContentType()
TestableResponse
getContentType in interface TestableResponsepublic String getOutput()
TestableResponseServletOutputStream as string.
getOutput in interface TestableResponse
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||