Create an HTML page called count.html and add the following content to it:
<html> <head> </head> <body> <center> <h3>Comet Example: Counter with Hidden Frame</h3> <p> <b id="count"> </b> <p> </center> </body> </html>
This page displays the current count.
Add the same code as for long-polling, except for the following line:
parent.hidden.location.href = “hidden_comet”
This line invokes the doGet method of CometServlet again, which would reestablish the connection. In the case of HTTP-Streaming, you want the connection to remain open. Therefore, you don't include this line of code.