问题
I've got a GWT application, which periodically needs to update the screen with new tick items as they come in. We also have messages published by a CometD/Bayeux server (for a different AJAX application) and I'd like to consume them in my GWT.
Of course, I can drop into JavaScript, hook up Dojo, and receive callbacks in the JavaScript layer - and from there, route a call into GWT Java code via a JSNI - but there doesn't appear to be any support in GWT directly for using long push or async calls other than the non-RESTful RPC.
How have you integrated GWT and Bayeux?
回答1:
Since this question was originally posted there have been a few advances:
- http://code.google.com/p/google-web-toolkit-incubator/wiki/ServerPushFAQ
- http://code.google.com/p/gwteventservice/
- http://code.google.com/p/gwt-comet/
回答2:
JSNI is not that bad option as it might sound first. There is a DZone refcardz 'GWT: Style, Configuration and JSNI Reference' which I have found helpful.
来源:https://stackoverflow.com/questions/1899925/how-can-i-connect-gwt-to-cometd-bayeux-events