I have example project StockWatcher using requestbuilder to
communicate with servlet (this example). I want to make servlet
asynchronous. I have added the following lines to the doGet method:

final AsyncContext ac = request.startAsync();
ac.setTimeout(1 * 60 * 1000);
ac.addListener(new AsyncListener() {

@Override
public void onError(AsyncEvent arg0) throws IOException {
            System.out.println("onError");
}

public void onComplete(AsyncEvent event) throws IOException {
            System.out.println("onComplete");
            queue.remove(ac);
}

public void onTimeout(AsyncEvent event) throws IOException {
            System.out.println("onTimeout");
            queue.remove(ac);
}

@Override
public void onStartAsync(AsyncEvent arg0) throws IOException {
            System.out.println("onStartAsync");

}
});
queue.add(ac);
added asynchronous annotation: @WebServlet(asyncSupported=true) and
changed the rest of doGet method with:

PrintWriter out = ac.getResponse().getWriter();
out.println("Something");
out.flush();
Now there is nothing returning. What do I wrong? Have to change
something in client side? Glassfish 3 does not show any errors.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to