Since Primefaces push is deprecated, i want to change to JSF 2.3 with f:websocket.
Therefore i added a websocket in my xhtml:
<h:form>
<f:websocket channel="testChannel" onmessage="socketListener" />
<h:outputScript>
function socketListener(message, channel, event) {
console.log(message);
}
</h:outputScript>
</h:form>
And i added a Bean to send Pushs:
@Named("PushTestBean")
@ApplicationScoped
public class TestPush {
@Inject
@Push(channel = "testChannel")
private PushContext push;
public void test() {
push.send("test");
}
}
In my web.xml i have:
<context-param>
<param-name>javax.faces.ENABLE_WEBSOCKET_ENDPOINT</param-name>
<param-value>true</param-value>
</context-param>
I added the jsf 2.3 jars as described to my wildfly 11.0.0 server. Compilation and deployment works without any problems. But when i navigate to the page with the socket i get an exception:
2018-02-15 22:41:48,224 ERROR [de.digitaljukebox.web.exceptionHandler.CustomExceptionHandler] (default task-96) Error while rendering view: javax.faces.application.ViewHandler.getWebsocketURL(Ljavax/faces/context/FacesContext;Ljava/lang/String;)Ljava/lang/String;