Class WebSocketWebAppInit

  • All Implemented Interfaces:
    org.zkoss.zk.ui.util.WebAppCleanup, org.zkoss.zk.ui.util.WebAppInit

    public class WebSocketWebAppInit
    extends java.lang.Object
    implements org.zkoss.zk.ui.util.WebAppInit, org.zkoss.zk.ui.util.WebAppCleanup
    A WebAppInit implementation for WebSocket connection. Available in ZK EE. In WEB-INF/zk.xml, add following lines to enable WebSocket connection:
    
            <listener>
                    <listener-class>org.zkoss.zkmax.au.websocket.WebSocketWebAppInit</listener-class>
            </listener>
     
    To change the update URL, you could also add the following lines into WEB-INF/zk.xml. (Optional) If not specified, "/zkwm" will be used by default.
    
            <library-property>
                    <name>org.zkoss.zkmax.au.websocket.WebSocketEndPoint.urlPattern</name>
                    <value>/yourApp</value>
            </library-property>
     
    When WebSocket connection is enabled, we'll use WebSocketServerPush by default when server-push started. Note that we cannot guarantee the accessing of the information provided by http requests when WebSocket connection is enabled.
    Since:
    8.5.0
    Author:
    wenninghsu
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cleanup​(org.zkoss.zk.ui.WebApp wapp)  
      static java.lang.String getWebSocketUrl()
      Returns websocket url.
      void init​(org.zkoss.zk.ui.WebApp wapp)  
      static boolean isFilterInstalled​(org.zkoss.zk.ui.WebApp wapp)
      Returns whether the websocket filter has been installed.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WebSocketWebAppInit

        public WebSocketWebAppInit()
    • Method Detail

      • init

        public void init​(org.zkoss.zk.ui.WebApp wapp)
                  throws java.lang.Exception
        Specified by:
        init in interface org.zkoss.zk.ui.util.WebAppInit
        Throws:
        java.lang.Exception
      • isFilterInstalled

        public static boolean isFilterInstalled​(org.zkoss.zk.ui.WebApp wapp)
        Returns whether the websocket filter has been installed.
        Since:
        8.5.1
      • getWebSocketUrl

        public static java.lang.String getWebSocketUrl()
        Returns websocket url.
        Since:
        8.5.1
      • cleanup

        public void cleanup​(org.zkoss.zk.ui.WebApp wapp)
                     throws java.lang.Exception
        Specified by:
        cleanup in interface org.zkoss.zk.ui.util.WebAppCleanup
        Throws:
        java.lang.Exception