We have a Java servlet that sends HTML code to a browser.

The environment is:

  Linux RedHat V6.2
  JRE V1.2.2/1.3.0 for Linux from Sun
  JSDK V2.1 (using servletRunner to run servlet)
  Internet Explorer V5.0/5.5
  Netscape Navigator V4.5/4.73

Here is the code that sends HTML to the browser (the response object is an
HttpServletResponse):


  response.setContentType("text/html");
  response.setContentLength(outputStringBuffer.length());

  PrintWriter output = response.getWriter();

  output.print(outputStringBuffer.toString());
  output.flush();

  Thread.sleep(5000);
  output.close();


Pages sent by this code fail to be displayed under the following
browser-related conditions:


1) IE V5.0/5.5

First time a page is sent to IE, it displays OK.

Second time a page is sent, IE correctly displays the page after the
flush(),
and continues to display it during the 5 second pause. But when the close()
occurs, IE immediately displays its standard "The page cannot be displayed"
error page.

If we wait about 2 minutes before trying to send again, IE displays the page
OK. But if we send again before 2 minutes is up, IE immediately fails to
display the page.

We've seen this IE behaviour when running the servlet under JRE V1.2.2 and
V1.3.0 on a Linux system, but when the servlet runs under JRE V1.2.1 on NT
or
Solaris, IE has no problems.


2) Netscape V4.5

Displays a page OK as long as the pause occurs before the close(). If the
pause is removed entirely, Netscape V4.5 fails to display the page.


3) Netscape V4.73

Always displays a page OK, without or without the pause.


The above occurs for pause values from 2 to 5 seconds.

The same problem occurs when we run the code but not perform the explicit
close().

Has anyone else seen this or similar behaviour?

Thanks,

Kieran Jones

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to