java.lang.Object
org.apache.wicket.request.Response
- Direct Known Subclasses:
WebResponse
Abstract base class for different implementations of response writing.
The implementation may not support calling both write(byte[]) and
write(CharSequence) on the same Response instance.
- Author:
- Matej Knopp, igor.vaynberg
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the responseabstract StringencodeURL(CharSequence url) Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged.abstract ObjectProvides access to the low-level container response object that implementaion of thisResponsedelegate to.Returns anOutputStreamsuitable for writing binary data in the response.voidreset()Called when the Response needs to reset itself.abstract voidwrite(byte[] array) Writes the buffer to output.abstract voidwrite(byte[] array, int offset, int length) Writes the buffer to output.abstract voidwrite(CharSequence sequence) Writes theCharSequenceto output.
-
Constructor Details
-
Response
public Response()
-
-
Method Details
-
write
Writes theCharSequenceto output.- Parameters:
sequence-- Throws:
IllegalStateException- ifwrite(byte[])has already been called on this instance
-
write
Writes the buffer to output.- Parameters:
array- the data.- Throws:
IllegalStateException- ifwrite(CharSequence)has already been called on this instance
-
write
Writes the buffer to output.- Parameters:
array- the data.offset- the start offset in the data.length- the number of bytes to write.- Throws:
IllegalStateException- ifwrite(CharSequence)has already been called on this instance- Since:
- 1.5.1
-
close
Closes the response -
encodeURL
Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged.- Parameters:
url-- Returns:
- encoded URL
-
reset
Called when the Response needs to reset itself. Subclasses can empty there buffer or build up state. -
getContainerResponse
Provides access to the low-level container response object that implementaion of thisResponsedelegate to. This allows users to access features provided by the container response but not by generalized WicketResponseobjects.- Returns:
- low-level container response object, or
nullif none
-
getOutputStream
Returns anOutputStreamsuitable for writing binary data in the response. The servlet container does not encode the binary data.Calling flush() on the OutputStream commits the response.
This method returns an output stream that delegates to
write(byte[]),write(byte[], int, int), andclose()methods of this response instance- Returns:
- output stream
-