public interface AuWriter
AuRequest.
To use the writer, open(java.lang.Object, java.lang.Object) must be called first.
And, close(java.lang.Object, java.lang.Object) after all responses are written.
AuWriters.setImplementationClass(java.lang.Class)| Modifier and Type | Method and Description |
|---|---|
void |
close(java.lang.Object request,
java.lang.Object response)
Closes the writer and flush the result to client.
|
java.lang.Object |
complete()
Indicates the writing has been completed.
|
AuWriter |
open(java.lang.Object request,
java.lang.Object response)
Initializes the writer.
|
void |
resend(java.lang.Object prevContent)
Resend the content of the previous request returned by
complete(). |
void |
setCompress(boolean compress)
Sets whether to compress the output with GZIP.
|
void |
write(AuResponse response)
Generates the specified the response to the output.
|
void |
write(java.util.Collection<AuResponse> responses)
Generates a list of responses to the output.
|
void |
writeResponseId(int resId)
Generates the response ID to the output.
|
void setCompress(boolean compress)
Default: true.
AuWriter open(java.lang.Object request, java.lang.Object response) throws java.io.IOException
request - the request (HttpServletRequest if HTTP)response - the response (HttpServletResponse if HTTP)java.io.IOExceptionvoid close(java.lang.Object request,
java.lang.Object response)
throws java.io.IOException
request - the request (HttpServletRequest if HTTP)response - the response (HttpServletResponse if HTTP)java.io.IOExceptionjava.lang.Object complete()
throws java.io.IOException
close(java.lang.Object, java.lang.Object),
if the caller supports the resend mechanism.
The caller usually stores the return value to a desktop by
DesktopCtrl.responseSent(java.lang.String, java.lang.Object)).
Unlike close(java.lang.Object, java.lang.Object), this method must be called
in an activated execution.
Once this method is called, the caller shall not invoke
any other write method. It shall invoke only close(java.lang.Object, java.lang.Object)
to end the writer.
java.io.IOExceptionvoid resend(java.lang.Object prevContent)
throws java.io.IOException
complete().
The content is usually stored to a desktop
by DesktopCtrl.responseSent(java.lang.String, java.lang.Object),
and retrieved by DesktopCtrl.getLastResponse(java.lang.String).
Once this method is called, the caller shall not invoke
any other write method nor complete().
It shall invoke only close(java.lang.Object, java.lang.Object) to end the writer.
prevContent - the previous content returned by
close(java.lang.Object, java.lang.Object) of the previous AuWriter.java.lang.IllegalArgumentException - if prevContent is null.java.lang.IllegalStateException - if any of write methods
(such as write(org.zkoss.zk.au.AuResponse)) is called.java.io.IOExceptionvoid writeResponseId(int resId)
throws java.io.IOException
java.io.IOExceptionDesktopCtrl.getResponseId(boolean)void write(AuResponse response) throws java.io.IOException
java.io.IOExceptionvoid write(java.util.Collection<AuResponse> responses) throws java.io.IOException
java.io.IOExceptionCopyright © 2005-2024 Potix Corporation. All Rights Reserved.