f

Tag websocket

Component Information 
InfoValue
Component Typejakarta.faces.Websocket
Handler ClassNone
Renderer TypeNone
DescriptionNone
Attributes 
NameRequiredTypeDescription
bindingfalsejakarta.el.ValueExpression
(must evaluate to jakarta.faces.component.UIComponent)

Value binding expression to a backing bean property bound to the component instance for the UIComponent created by this tag.

idfalsejakarta.el.ValueExpression
(must evaluate to java.lang.String)

Component identifier of the UIWebsocket component to be created.

channeltruejakarta.el.ValueExpression
(must evaluate to java.lang.String)

The name of the websocket channel. It may not be an EL expression and it may only contain alphanumeric characters, hyphens, underscores and periods. All open websockets on the same channel name will receive the same push notification from the server.

scopefalsejakarta.el.ValueExpression
(must evaluate to java.lang.String)

The scope of the websocket channel. It may not be an EL expression and allowed values are application, session and view, case insensitive. When the value is application, then all channels with the same name throughout the application will receive the same push message. When the value is session, then only the channels with the same name in the current user session will receive the same push message. When the value is view, then only the channel in the current view will receive the push message. The default scope is application. When the user attribute is specified, then the default scope is session.

userfalsejakarta.el.ValueExpression
(must evaluate to java.io.Serializable)

The user identifier of the websocket channel, so that user-targeted push messages can be sent. It must implement Serializable and preferably have low memory footprint. Suggestion: use #{request.remoteUser} or #{someLoggedInUser.id}. All open websockets on the same channel and user will receive the same push message from the server.

onopenfalsejakarta.el.ValueExpression
(must evaluate to java.lang.String)

The JavaScript event handler function that is invoked when the websocket is opened. The function will be invoked with one argument: the channel name.

onmessagefalsejakarta.el.ValueExpression
(must evaluate to java.lang.String)

The JavaScript event handler function that is invoked when a push message is received from the server. The function will be invoked with three arguments: the push message, the channel name and the raw MessageEvent itself.

onerrorfalsejakarta.el.ValueExpression
(must evaluate to java.lang.String)

The JavaScript event handler function that is invoked when a connection error has occurred and the websocket will attempt to reconnect. The function will be invoked with three arguments: the error reason code, the channel name and the raw CloseEvent itself. Note that this will not be invoked on final close of the websocket, even when the final close is caused by an error. See also RFC 6455 section 7.4.1 and CloseCodes API for an elaborate list of all close codes.

onclosefalsejakarta.el.ValueExpression
(must evaluate to java.lang.String)

The JavaScript event handler function that is invoked when the websocket is closed and will not anymore attempt to reconnect. The function will be invoked with three arguments: the close reason code, the channel name and the raw CloseEvent itself. Note that this will also be invoked when the close is caused by an error and that you can inspect the close reason code if an actual connection error occurred and which one (i.e. when the code is not 1000 or 1008). See also RFC 6455 section 7.4.1 and CloseCodes API for an elaborate list of all close codes.

connectedfalsejakarta.el.ValueExpression
(must evaluate to java.lang.Boolean)

Whether to (auto)connect the websocket or not. Defaults to true. It's interpreted as a JavaScript instruction whether to open or close the websocket push connection. This attribute is implicitly re-evaluated on every ajax request by a PreRenderViewEvent listener on the UIViewRoot. You can also explicitly set it to false and then manually control in JavaScript by faces.push.open(clientId) and faces.push.close(clientId).

renderedfalsejakarta.el.ValueExpression
(must evaluate to java.lang.Boolean)

Whether to render the websocket scripts or not. Defaults to true. This attribute is implicitly re-evaluated on every ajax request by a PreRenderViewEvent listener on the UIViewRoot. If the value changes to false while the websocket is already opened, then the websocket will implicitly be closed.