Client side Callback in GWT

人走茶凉 提交于 2019-12-05 11:06:04

Well, there are a couple of Options. You need to get the data from the server... So you either need to poll the server, or use server push.

Polling is pretty easy. Just use the Timer class to repeatedly call a service to see what value it should be displaying.

Server push is done using something like comet. here is one implementation for gwt that looks somewhat promising. They basic concept behind this is the browser sends a request to the server and keeps the connection open so the server is free to keep sending data back.

Comet is the better option if you can get it working. It will probably be simpler and scale better.

Good Luck!

Polling is probably the best way to do what you're looking for. The big gotcha with GWT is that everything has to be serializable. I'm not sure if anything that can push to the browser can be easily serialized.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!