Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-729

EventQueue with session scope in Tomcat

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Normal Normal
    • None
    • 5.0.9
    • General
    • Windows 7
      Tomcat

      We have a little strange issue with the use of the EventQueue (ZK 5.0.9) and Tomcat.

      We are using the EventQueue to throw an Event from one Composer to another which aren't using the same Desktop. Therefore we are using the Session scope to create the EventQueue :

      EventQueue eq = EventQueues.lookup("paymentQueue", EventQueues.SESSION, true);
      When we throw the Event in the first Composer, we add a Parameter list as the Object in the Event :

      Map params = comp.getDesktop().getExecution().getParameterMap();
      eq.publish(new Event("onPaymentSuccess, null, params));
      In the second Composer the event is thrown correct, but the get the event.getData() is now empty.

      final EventQueue eq = EventQueues.lookup("paymentQueue", EventQueues.SESSION, true);
      eq.subscribe(
      new EventListener() {
      public void onEvent(Event evt) {
      if (evt.getName().startsWith("onPaymentSuccess"))

      { Map params = (Map) evt.getData(); }

      eq.unsubscribe(this);
      }
      }
      );

      This works fine using Jetty, but deployed on Tomcat the data is empty. This is tried on both Tomcat 6 & 7.

      I have tried to switch to Polling Server Push without any success.

      <device-config>
      <device-type>ajax</device-type>
      <server-push-class>org.zkoss.zk.ui.impl.PollingServerPush</server-push-class>
      </device-config>

      I've also tried using the Application Scope with the same issue.

            jumperchen jumperchen
            GzusDK GzusDK
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: