public class WebSocketWebAppInit extends java.lang.Object implements WebAppInit, WebAppCleanup
<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.Constructor and Description |
---|
WebSocketWebAppInit() |
Modifier and Type | Method and Description |
---|---|
void |
cleanup(WebApp wapp)
called when a ZK application is about to be destroyed.
|
static java.lang.String |
getWebSocketUrl()
Returns websocket url.
|
void |
init(WebApp wapp)
Called when a ZK application is created and initialized.
|
static boolean |
isFilterInstalled(WebApp wapp)
Returns whether the websocket filter has been installed.
|
public void init(WebApp wapp) throws java.lang.Exception
WebAppInit
You could
retrieve the servlet context by WebApp.getServletContext()
init
in interface WebAppInit
java.lang.Exception
public static boolean isFilterInstalled(WebApp wapp)
public static java.lang.String getWebSocketUrl()
public void cleanup(WebApp wapp) throws java.lang.Exception
WebAppCleanup
If this method throws an exception, the error message is only logged (user won't see it).
cleanup
in interface WebAppCleanup
java.lang.Exception
Copyright © 2005-2023 Potix Corporation. All Rights Reserved.