3

当我更改 index2.xhtml 中的数据并单击命令按钮时,我需要刷新 index1.xhtml 中的 dataTable(index1.xhtml 和 index2.xhtml 由客户端打开)。
我不想使用轮询。

4

1 回答 1

3

如果您不想使用轮询,可以使用 primefaces push。我看不到任何其他选项,服务器必须通知您数据已更改。Primefaces push 会更好,因为更轻,无论如何要小心它尚未在所有浏览器中可用(请参阅:http ://caniuse.com/#feat=websockets )。例如,当使用 JMS 在 index1.xhtml 中发生某些更改时,您需要构建一种机制来向连接到 index2.xhtml 的所有客户端发布消息。你也应该知道 websockets 不会通过 AJP。

于 2013-04-15T07:17:35.257 回答