Hi Jianhong,
 
I suspect you put those records into a table.. if that is the case.. bad news.. Navigator or IE will only display the table once the table is 100% complete (starting from <table>... until.. </table>). :P~~
 
Don't use table, then you will be fine.
 
s�di.
----- Original Message -----
From: Jianhong
To: [EMAIL PROTECTED]
Sent: Friday, May 21, 1999 9:33 AM
Subject: How to display records one by one.

Hi, everyone,
 
I wrote a little servlet which get data from the browser and forward it to a proxy server and then get response records from the server to display them in the browser.
 
I want to display the records right away when the servlet get them from server, so I use function flush(), but it seems have no effect, because all records will be displayed together after all is gotten.
 
Here is a snip of the servlet. I don't know how to achieve my thoughts, any reply would be welcome.
 
Jianhong
 
 
 protected void doPost(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
 {
  try {
    ...
    // read data from proxy server
   for (int i=0; i<nCount; i++) {
    int nLength = din.readInt();
    if (nLength > 0) {
     byte bytes[] = new byte[nLength];
     din.readFully(bytes);
     out.println(new String(bytes));
     out.flush();
    }
   }
    ...

Reply via email to