Oracle GlassFish Server 3.0.1 Application Development Guide

ProcedureTo Create a HTML Welcome Page That Contains IFrames for Receiving and Sending Updates

  1. Create an HTML page called index.html.

  2. Add the following content to the page:

    		<title>Comet Example: Counter with Hidden Frame</title>
  3. Add IFrames for connecting to the server and receiving and sending updates to index.html in between the body tags:

    	<iframe name="hidden" src="hidden_comet" 
    		frameborder="0" height="0" width="100%"></iframe>
    	<iframe name="counter" src="count.html" 
    		frameborder="0" height="100%" width="100%"></iframe>
    <iframe name="button" src="button.html" frameborder="0" height="30%" widget="100%"></iframe>

    The first frame, which is hidden, points to the servlet by referencing its context path. The second frame displays the content from count.html, which displays the current count. The second frame displays the content from button.html, which contains the submit button for incrementing the counter.