Before running a Comet-enabled application in the GlassFish Server, you need to enable Comet in the server. Then you can deploy the application just as you would any other web application.
When running the application, you need to connect to it from at least two different browsers to experience the effect of the servlet updating all clients in response to one client posting an update to the server.
Before running a Comet-enabled application, you need to enable Comet in the HTTP listener for your application by setting a special attribute in the associated protocol configuration. The following example shows the asadmin set command that adds this attribute:
asadmin set server-config.network-config.protocols.protocol.http-1.http.comet-support-enabled="true"
Substitute the name of the protocol for http-1.
These instructions tell you how to deploy the Hidden Frame example.
Run the following command to deploy the example:
as-install/bin/asadmin deploy grizzly-comet-hidden-126.96.36.199.war
These instructions tell you how to run the Hidden Frame example.
Open two web browsers, preferably two different brands of web browser.
Enter the following URL in both browsers:
When the first page loads in both browsers, click the button in one of the browsers and watch the count change in the other browser window.