jquery - web client to get progressive server response - how to? -
been trying this, perhaps efforts not heading right, appreciate help. my html page has button , div. when click button, server has keep pushing numbers couple of seconds interval, , server pushes numbers, need them on div, progressively, in-synch server's status. how achieve this? tried using asynccontext, behaves similar response , flushes whole output @ end not want. protected void doget(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { response.setcontenttype("text/html"); asynccontext ac = request.startasync(request, response); ac.start(new runnable() { @override public void run() { (int = 1; <= 5; i++) { try { ac.getresponse().getwriter().print("hello-"+i); system.out.println("written hello"); thread.sleep(3000); } catch (exception e1) { e1....