我需要对聊天室实施长时间的轮询或待处理的请求.我尝试了a4j:push,但似乎不能像真正的长时间轮询方法那样工作(请参阅以下讨论: community.jboss/message/16614 ).
I need to implement long polling or pending request for a chatroom. I tried a4j:push, but it seems doesn't work like a real long polling approach (see the following discussion: community.jboss/message/16614).
问题是:我必须采用哪些替代方法来实现长时间轮询?
The question is: which alternatives do I have to realize long polling?
我正在使用JSF 1.2,JAVA EE 6和RichFaces 3.3.2.
I'm using JSF 1.2, JAVA EE 6 and RichFaces 3.3.2.
提前想好了!
推荐答案您需要使用RichFaces中的a4j:poll组件. exadel现场演示有一个非常好的示例,并解释了主要属性.另外,您可以在官方文档.
You need to use the a4j:poll component from RichFaces. The exadel live demo has a very nice sample and explains the main properties. Plus, you can get more info in the official documentation.
也许您想看一个聊天实现示例而不是轮询.有一个问题:
Maybe you want to look at a chat implementation example and not polling. There is a question about it:
stackoverflow/a/1577486/1065197
更多推荐
JSF的长轮询(待处理请求)
发布评论