-
Bug
-
Resolution: Fixed
-
Normal
-
8.5.0, 8.5.1.2
-
Security Level: Jimmy
-
enable websockets
-
ZK 8.5.2 S1, ZK 8.5.2 S2
-
None
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");
- relates to
-
ZK-3919 NPE fileupload when using Websockets (Tomcat)
- Closed