I have example project StockWatcher using requestbuilder to
communicate with servlet (http://code.google.com/intl/pl-PL/webtoolkit/
doc/latest/tutorial/JSON.html). 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 "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en

Reply via email to