Sorry, I should have waited for your response before doing it on my own. That looks good. However, I really would like to be able to switch off the polling completely. This spares loading and running the Javascript for the polling mechanism, and the shutdown, with all possible Javascript errors.
I like the idea of splitting the javascript up rather than a global flag.
There are two uses I can see for ajax_response. One is for long running requests (in my case, generating reports). The other is sending javascript commands to the client without the client first triggering an event (perhaps a chat application). The servlet can use ajax_cmdToClient for this second use.

Ok, I see. In the latter case, I would probably want to set the ajax_clientPollingInterval lower than in the former case, and make it less random. So I will implement the ajax_clientPollingInterval in a similar way. I will also add more comments and docstrings to the AjaxPage class in the Example context.
Right. It still needs a little randomness, though. You don't want to get in a situation where somehow the clients become synchronized and make all of their polling requests at the same time. A little randomness will avoid that.

By the way, I just saw the ajax_cmdToClient() method still uses the remote address instead of the session identifier.
oops. fixed in the wiki.

--John


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Webware-discuss mailing list
Webware-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to