Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-6232

When sending binary data from server to client, wicket-websocket-jquery.js throws error "message.indexOf is not a function"

    XMLWordPrintableJSON

    Details

      Description

      On the server I'm calling this method
      org.apache.wicket.protocol.ws.api.IWebSocketConnection.sendMessage(byte[] message, int offset, int length)

      The Wicket javascript client code (wicket-websocket-jquery.js) assumes the incoming message is a string and attempts to detect if it's an ajax response.

      self.ws.onmessage = function (event) {
      var message = event.data;
      if (message && message.indexOf('<ajax-response>') > -1)

      { var call = new Wicket.Ajax.Call(); call.process(message); }

      else

      { Wicket.Event.publish(topics.Message, message); }

      };

      https://github.com/apache/wicket/blob/master/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/res/js/wicket-websocket-jquery.js

        Attachments

          Activity

            People

            • Assignee:
              mgrigorov Martin Grigorov
              Reporter:
              cquarters C Quarters
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: