2 Replies Latest reply on Aug 14, 2008 10:57 AM by Jessie Crowe


    Chua Khoon Yong Novice

      hi any1,

      I was considering to use a4j:push for updating a web page. The consideration is to reduce network traffic overhead but still give real time response to user. But the developer guide description for a4j:push says that it "periodically perform Ajax request to server, to simulate 'push' data."

      Further reading the guide and tracing the source, it look similar to a a4j:poll but with some improvement in network load, as far as network traffic is concerned. I was a bit surprise on why a4j:push is being implemented in this manner?

      My questions are:

      Is it possible to implement real server push?

      or is there further improvement to a4j:push in future release?

      or this method of a4j:push is a good implementation, as compared to ICEFACES?

      Hope to gain more insights into this.
      Thank you.

        • 1. Re: a4j:push
          Chua Khoon Yong Novice

          hi every1,

          Was looking at the code for a4j:push again, and wondering if it is possible to implement ajax push by long polling. See this website for the meaning:


          It may be possible to do long polling by extending the BaseFilter.java, see existing code snippet below:

          Sorry, i am not familiar on how to modify functionality to the richfaces sources.

          Any advices any1 on how to do this long polling ?

          if (request.getAttribute(FILTER_PERFORMED) != Boolean.TRUE) {
           // mark - and not processing same request twice.
           try {
           request.setAttribute(FILTER_PERFORMED, Boolean.TRUE);
           String ajaxPushHeader = httpServletRequest
           // check for a push check request.
           if (httpServletRequest.getMethod().equals("HEAD")
           && null != ajaxPushHeader) {
           PushEventsCounter listener = eventsManager
           // To avoid XmlHttpRequest parsing exceptions.
           if (listener.isPerformed()) {
           httpServletResponse.setHeader(AJAX_PUSH_STATUS_HEADER, AJAX_PUSH_READY);
           if (log.isDebugEnabled()) {
           log.debug("Occurs event for a id " + ajaxPushHeader);
           } else {
           // Response code - 'No content'
           if (log.isDebugEnabled()) {
           log.debug("No event for a id " + ajaxPushHeader);

          • 2. Re: a4j:push
            Jessie Crowe Newbie

            I am also interested in this topic. Since I am working on a large-scale commercial application, I am worried about the performance of the a4j:push tag. Can anyone speak to load tests or anything like that for this tag? Specifically I would like to see comparisons between a4j:push and the older a4j:poll tag.