wicket.response
Class BufferedResponse

java.lang.Object
  extended bywicket.Response
      extended bywicket.response.BufferedResponse

public class BufferedResponse
extends Response

Holds a rendered response for future use.

Author:
Johan Compagner, Eelco Hillenius
See Also:
ApplicationSettings.RenderStrategy

Constructor Summary
BufferedResponse()
          Construct.
 
Method Summary
 void close()
          Closes the response output stream
 byte[] getBytes()
          Get the bytes of this buffered response string in the encoding of the mime type.
 int getContentLength()
          Gets the content length.
 java.lang.String getContentType()
          Get the content mime type.
 java.io.OutputStream getOutputStream()
           
 java.lang.String getRedirectUrl()
          The url to be used to issue a client side redirect request; when a request to the url comes in, this buffered response is streamed to the browser.
 java.lang.String getString()
          Prior to closing the response, the current content of the buffer.
 void redirect(java.lang.String url)
          A subclass may override this method to implement redirection.
 void setContentType(java.lang.String mimeType)
          Sets the content mimetype.
 void write(java.lang.String string)
          Writes the given string to the Response subclass output destination.
 
Methods inherited from class wicket.Response
encodeURL, getCharacterEncoding, isRedirect, setCharacterEncoding, setContentLength, setLastModifiedTime, setLocale, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferedResponse

public BufferedResponse()
Construct.

Method Detail

getRedirectUrl

public final java.lang.String getRedirectUrl()
The url to be used to issue a client side redirect request; when a request to the url comes in, this buffered response is streamed to the browser.

Returns:
The redirect url that is used for this response

getContentLength

public final int getContentLength()
Gets the content length.

Note: Prior to closing the response, the number of characters is returned. After closing, the number of bytes is returned, which depending on the encoding and the characters might be larger.

Returns:
The content length of this redirect response

getContentType

public final java.lang.String getContentType()
Get the content mime type.

Returns:
The content type of this redirect response

setContentType

public final void setContentType(java.lang.String mimeType)
Sets the content mimetype.

Overrides:
setContentType in class Response
Parameters:
mimeType -

redirect

public final void redirect(java.lang.String url)
Description copied from class: Response
A subclass may override this method to implement redirection. Subclasses which have no need to do redirection may choose not to override this default implementation, which does nothing. For example, if a subclass wishes to write output to a file or is part of a testing harness, there may be no meaning to redirection.

Overrides:
redirect in class Response
Parameters:
url - The URL to redirect to
See Also:
Response.redirect(java.lang.String)

getOutputStream

public final java.io.OutputStream getOutputStream()
Specified by:
getOutputStream in class Response
Returns:
The output stream for this response
See Also:
Response.getOutputStream()

write

public final void write(java.lang.String string)
Description copied from class: Response
Writes the given string to the Response subclass output destination.

Specified by:
write in class Response
Parameters:
string - The string to write
See Also:
Response.write(java.lang.String)

close

public final void close()
Description copied from class: Response
Closes the response output stream

Overrides:
close in class Response
See Also:
Response.close()

getBytes

public final byte[] getBytes()
Get the bytes of this buffered response string in the encoding of the mime type.

Returns:
after closing the response, the encoded bytes, else null.

getString

public final java.lang.String getString()
Prior to closing the response, the current content of the buffer. After closing the response, an exception will be thrown as the buffer is no longer available.

Returns:
String The buffer content


Copyright © 2004-2006 Wicket developers. All Rights Reserved.