关于html:从服务器端,如何更新客户端网页中的数据? | 珊瑚贝

From the server side, how to update data in the client web page?


在一个 java web 应用程序中,我试图显示一个页面,其中显示的项目在服务器端进行了更新。

基本上,我想显示一个页面,用户可以在其中选择一组任务,然后启动这些任务(目前,没什么困难)。
然后,我想显示一个页面,用户可以在其中监控任务的状态(等待、运行、结束……)。

为了避免客户端从服务器端轮询服务器或刷新定时器=>,如何更新客户端网页中的数据?

JSF 能解决这些问题吗?
我尝试使用 java FX,但它似乎很慢,需要安装 Java FX RE(我的用户不可能)。
GWT 呢?

感谢您的帮助。

  • Is there a real server push over http? 的可能重复项?


您正在寻找彗星或长轮询技术。这是带有很好解释的一般描述:http://www.ibm.com/developerworks/web/library/wa-reverseajax4/?ca=drs-
此外,cometd 网站,将与 jquery 或 dojo 一起使用:http://cometd.org/ I

另一种解决方案是 Atmosphere:https://github.com/Atmosphere/atmosphere
也在这里:http://jfarcand.wordpress.com/2010/06/15/using-atmospheres-jquery-plug-in-to-build-applicationsupporting-both-websocket-and-comet/

  • 非常感谢您的投入,我对反向 ajax 概念完全陌生,IBM 文章确实帮助了我。在阅读了它和有关该主题的其他输入之后,我选择了应该适合我需要的 Cometd。
  • @Stepane我刚遇到这个:dojotoolkit.org/features/1.6/dojo-websocket


我通过使用icefaces push 库做了这样的事情(push)。
看这里


来源:https://www.codenong.com/9062606/

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_9014.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?