-
1. Re: a4j:push
chuaky Jul 9, 2008 12:07 AM (in response to chuaky)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:
http://weblogs.java.net/blog/jfarcand/archive/2007/05/new_adventures.html
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 ?
Thanks.if (request.getAttribute(FILTER_PERFORMED) != Boolean.TRUE) { // mark - and not processing same request twice. try { request.setAttribute(FILTER_PERFORMED, Boolean.TRUE); String ajaxPushHeader = httpServletRequest .getHeader(AJAX_PUSH_KEY_HEADER); // check for a push check request. if (httpServletRequest.getMethod().equals("HEAD") && null != ajaxPushHeader) { PushEventsCounter listener = eventsManager .getListener(ajaxPushHeader); // To avoid XmlHttpRequest parsing exceptions. httpServletResponse.setContentType("text/plain"); if (listener.isPerformed()) { listener.processed(); httpServletResponse.setStatus(HttpServletResponse.SC_OK); 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' httpServletResponse.setStatus(HttpServletResponse.SC_ACCEPTED); if (log.isDebugEnabled()) { log.debug("No event for a id " + ajaxPushHeader); }
-
2. Re: a4j:push
dragonfly0806 Aug 14, 2008 10:57 AM (in response to chuaky)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.