JQuery plugin problems

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

JQuery plugin problems

mateusz.wiercinski
Hi, I'm trying to get the jQuery Atmosphere plugin working but I've
encountered two problems:
- Under IE I cannot get the callback function to be called, it seems to
be cached somewhere because as soon as I close my server all callbacks
are resumed. Firefox works flawlessly
- It seems impossible to establish two channels simultaneously on one
page, after doing that I receive responses with status != 200. Our app
uses encapsulated components and some of them would need to be
asynchronously updated. Is it some limitation of the plugin or just an
error on my side?
I'm using Atmosphere 0.7.2, Jetty 6.1.26, JSF (Mojarra) 2.0.6, however
the same symptoms come under Atmosphere 0.6.5 and 0.6.3 and JSF 2.0.4.
Changing transports from websocket to long-polling or streaming also
doesn't help. Thanks in advance for any help.

Relevant fragments:
web.xml:
<servlet>
    <servlet-name>Comet Servlet</servlet-name>
   
<servlet-class>com.horus.hflow.web.comet.MyCometServlet</servlet-class>
    <init-param>
      <param-name>org.atmosphere.useWebSocket</param-name>
      <param-value>true</param-value>
    </init-param>
    <init-param>
      <param-name>org.atmosphere.useStream</param-name>
      <param-value>true</param-value>
    </init-param>
    <init-param>
      <param-name>org.atmosphere.useNative</param-name>
      <param-value>true</param-value>
    </init-param>
    <init-param>
      <param-name>org.atmosphere.cpr.WebSocketProcessor</param-name>
     
<param-value>org.atmosphere.cpr.HttpServletRequestWebSocketProcessor</p
aram-value>
    </init-param>
    <init-param>
     
<param-name>org.atmosphere.cpr.broadcastFilterClasses</param-name>
     
<param-value>org.atmosphere.client.JavascriptClientFilter</param-value>
    </init-param>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>Comet Servlet</servlet-name>
    <url-pattern>/comet_path/*</url-pattern>
  </servlet-mapping>

push.xhtml:
<script type="text/javascript">
          $(document).ready(function() {
            function callback(response) {
              if (response.status == 200) {
               
jsf.ajax.request(document.getElementById('#{cc.attrs.cid}'), null, {
render: '#{cc.attrs.cid}'});
              }
            }
            var location = 'comet_path/#{cc.attrs.channel}';
            $.atmosphere.subscribe(location, callback,
$.atmosphere.request = { transport:'streaming',
fallbackTransport:'long-polling' });
          });
        </script>