tags:

views:

36

answers:

1

Hi, i have one application that run on Tomcat, The application is JSP pages that inturn calls A java file which is actually is the Batch process that inserts data into database.So i want show all the process happening to the client(browser),since all this is happening at server side.I want to get that output(Printed messages), so that i can use it to show it on client side(Browser). Anyone have idea,how can i retrieve this output from server?.

+1  A: 

You will need ajax. Check XmlHTTPRequest The idea is:

  1. send ajax requests to the server (a specific servlet) every X seconds
  2. define the aforementioned servlet, and define a LinkedList (or any Queue implementation).
  3. Fill that Queue whenever there is something to be outputted by the batch process
  4. On each ajax request pop all elements of the queue and send them as response
  5. After the response is returned, append it to the DOM of the page.
Bozho