public class SSEWriter extends Object
SSEvent with
write(SSEvent) to the client.
Example:
@ExtDirectMethod(ExtDirectMethodType.SSE)
public void sse(SSEWriter sseWriter) {
SSEvent event = new SSEvent();
event.set....
sseWriter.write(event);
//do something else or wait for something or ...
sseWriter.write(event);
//...
}
| Constructor and Description |
|---|
SSEWriter(javax.servlet.http.HttpServletResponse response) |
public void write(Object data) throws IOException
SSEvent object and sets the data property to the
provided parameter. Then it writes the event into the servlet output
stream and flushes the response.data - the value that becomes the data part of the SSEvent.
If null nothing is written.IOExceptionpublic void write(SSEvent sseEvent) throws IOException
sseEvent - the event objectIOExceptionCopyright © 2010-2013. All Rights Reserved.