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

user agent information missing during websocket request

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.5.2
    • 8.5.0, 8.5.1.2
    • ZK Update Engine
    • Security Level: Jimmy
    • enable websockets

    • ZK 8.5.2 S1, ZK 8.5.2 S2

      Steps to Reproduce

      enable websockets
      run the attachment ws-useragent-missing.zul
      click the button

      Current Result

      during an execution via websockets the user agent information is missing

      Expected Result

      useragent information should be available

      Workaround

      store the user agent information (related information) as a desktop scoped attribute (when the page loads) for later retrieval during websocket requests e.g using a DesktopInit listener

      public void init(Desktop desktop, Object request) {
        deskop.setAttribute("my.useragent", desktop.getExecution().getUserAgent());
        deskop.setAttribute("my.mobile", desktop.getExecution().getBrowser("mobile"));
      }
      

      And retrieve the same information later:

      String useragent = (String)Executions.getCurrent().getDesktop().getAttribute("my.useragent");
      String mobile = (String)Executions.getCurrent().getDesktop().getAttribute("my.mobile");
      

            wenninghsu wenninghsu
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: