GWT 客户端状态
我开始使用 gwt,但在识别客户端状态时遇到一些问题。
我正在使用 GWTEventService 将一些数据推送到客户端。但这些数据取决于客户端所在的选项卡。但是如何在不使用 cookie 的情况下了解客户端的状态(例如,选择了哪个单选按钮)。由于我每 5 秒发送一次事件,因此使用 cookie 检查我想要发送的每个事件的客户端状态会使应用程序变得非常慢。
谁能帮助我吗?
谢谢你, 毛里西奥
I am starting to use gwt and I am having some problems to identify the clients state.
I am using GWTEventService to push some data to the client. But this data depends on which tab the client is. But how to know the state of the client (eg. which is the radio button selected)without using cookies. As I am sending events each 5 seconds, check the client state using cookies to each event that I want to send would make the application become very slow.
Can anyone help me?
Thank you,
Maurício
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议采用不同的设计方法。让客户端从服务器拉取数据,而不是将数据推送到客户端。我广泛使用 GWT-RPC 来执行此操作:http://code. google.com/webtoolkit/doc/latest/tutorial/RPC.html
如果该方法不适合您,则下一个最佳方法是,每当客户端状态发生变化时,通知服务器,以便它始终知道国家。然后,您可以通过会话来跟踪客户。
I would suggest a different design approach. Instead of pushing data to the client, have the client pull the data from the server. I have used GWT-RPC extensively to do this: http://code.google.com/webtoolkit/doc/latest/tutorial/RPC.html
If that approach doesn't work for you, the next best approach, whenever the state of the client changes, notify the server, so it always knows the state. You could then to client tracking with sessions.