Hi,

I have a servlet that outputs a lot of data, which works fine most of the
time, but once in a while the data on the screen shows up all mangled up.
When I check the HTML source of the page, everything seems fine, and when I
save the html source as a file and open it, it looks fine too. I'm using
Tomcat 3.1.1 and JDK1.3 on a Linux platform. I thought it may be a buffer
problem, so I set the buffer size to 16384 on the response.

Here is the skeleton of the servlet:
{
         response.setHeader("pragma", "no-cache");
         response.setHeader( "Cache-Control","no-cache" );
         response.setHeader( "Cache-Control","no-store" );
         response.setHeader( "Expires", new Date().toString());

         response.setContentType("text/html");

         response.setBufferSize(16384);

         // Get the PrintWriter to write the response
         out = response.getWriter();

         // Write the page header
         out.println("<html>");
         out.println("<head>");
         out.println("<title>"+pageTitle+"</title>");
         out.println("</head>");

         out.println("<body>");
         // body of the page
         .
         .
         out.println("</body>");
         out.println("</html>");

         out.flush();
         out.close();
}
-------------

Is there anything else I should try?

Thanks,
Gopi


-----------
Gopi Mandava                            (703) 267-1735 x307
CoManage Inc.

"I thought of that while riding my bike."
         -Albert Einstein, on the theory of Relativity

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to