About WebSockets in JSF
Java Platform, Enterprise Edition (Java EE) 8
The Java EE Tutorial

Previous Next Contents

About WebSockets in JSF

You use the f:websocket tag in a view to allow server-side communications to be pushed to all instances of a socket containing the same channel name. When the communication is received, an onmessage, client-side JavaScript event handler can be set that is called whenever a push arrives from the server.

The server side of a WebSocket communication has the ability to push out messages. You can do this using javax.faces.push.PushContext, which is an injectable context, allowing a server push to a named channel.


Previous Next Contents
Oracle Logo  Copyright © 2017, Oracle and/or its affiliates. All rights reserved.