0

I have a Java chat-like application using Comet using Grizzly Comet, which works in Chrome but not in Firefox (latest versions of both). It uses the HTTP streaming method, sending Javascript snippets down to a hidden iframe ("forever frame") to be executed. On Firefox, no chat messages are displayed initially, until a few messages have been sent by a Chrome user - then it springs to life and works.

No proxy is in use, so it's not a proxy issue.

What could be the problem?

Robin Green
  • 32,079
  • 16
  • 104
  • 187

1 Answers1

1

Ensure that you have both of these lines when you addCometHandler:

        response.setContentType("text/html");
        // Needed to fill buffer on some browsers 
        response.getWriter().write(padding);

padding in this case is an array of characters, and can be anything, as long as it won't do anything and is sufficiently long to trigger buffering in all browsers (1K should be enough). I just filled it with spaces.

Robin Green
  • 32,079
  • 16
  • 104
  • 187