tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ALEXANDROS KOTSIRAS" <ALEXANDRO...@prodigy.net>
Subject Re: Servlet buffering
Date Sun, 23 Jul 2000 20:25:23 GMT
Probably this is not the answer to your question but why don't you also try : 
out.flush() 
Also in case you are using tables and format all the output in a big table keep in mind that
the browser cannot display the HTML output unless it reaches the 
</TABLE> cloasing tag. 
  ----- Original Message ----- 
  From: Hubert Gailly 
  To: tomcat-user@jakarta.apache.org 
  Sent: Sunday, July 23, 2000 9:14 AM
  Subject: Servlet buffering


  Hello , 

  I am new on this list and I hope that this is the right place for the question I want to
ask

  I am currently a Servlet and I would like to display the result in the browser line by line.
  my problem is that <HttpServletResponse>.setBufferSize(0);  and/or 
  <HttpServletResponse>.flushBuffer(); do not seem to work and that the browser receive
the page by packet of more or less 1Kb
   
  Can anybody tell me what I am doing wrong or what I am missing?
   
   
  Thanks in advance,
   
  Hubert
              
  This is some code /

    public void doPost(HttpServletRequest req, HttpServletResponse res)
                                  throws ServletException, IOException 
  {
      res.setContentType("text/html");
      res.setBufferSize(0);  // CHANGE NOTHING
      PrintWriter out = res.getWriter();

      try 
      {
         out.println("<HTML><BODY>"); 
            boolean isOK = true;
              while (isOK )
               {
                  // Some treatment here

                    out.println("IMPORT - Fiche No ....");
                    res.flushBuffer();// CHANGE NOTHING

                   if (...)
                     isOK  = false;    
               }

        }
      }
      catch (Exception e) {
            out.println("<PRE>");
            e.printStackTrace(out);
            out.println("</PRE>");
      }
      out.println("</BODY></HTML>");
    }

  ERELINE (groupe Quantix), 20 rue de Madrid, 75008 Paris, 01 45 22 06 06
  Hubert Gailly (hgailly@Ereline.fr) Phone: 04 66 03 18 58
  - Les solutions e-marketing


   

Mime
View raw message