John Dickinson wrote:
Instead of turning the polling off, would setting the client polling interval to some big number be good enough? I added an ajax_clientPollingInterval to AjaxPage so that a child page can easily set the polling interval (long if it doesn't need it, short if it does).

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.

Also I added an auto_connect flag to the javascript that will prevent the client from connecting to ajax_response on the server at all. It could be set to false for a site that would never need the ajax_response mechanism.

But it is not so easy to set it to false from the Webware servlet (you have to make two versions of the Javascript file).

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.

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

-- Christoph





-------------------------------------------------------
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