Is it possible to work with reverse Ajax in JSF 2.0?
I could work with Ajax in JSF, but I don't know how to keep rendering. Any idea?
With reverse Ajax you have polling where the client repeatedly queries the server looking for a response, and you have pushing where the server keeps a connection with the client and sends a response when available.
Richfaces has <a4j:poll>
and <a4j:push>
as part of its ajax support.
The
<a4j:push>
periodically perform AJAX request to server, to simulate 'push' data.The main difference between
<a4j:push>
and<a4j:poll>
components is that<a4j:push>
makes request to minimal code only (not to JSF tree) in order to check the presence of messages in the queue. If the message exists the complete request will be performed. The component doesn't poll registered beans but registers EventListener which receives messages about events.
Primefaces has p:poll.
<a4j:push>
has the advantage to use CDI events.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With