Declare tag in the JSF view with at least a channel name and an onmessage JavaScript listener function. The channel name may not be an EL expression and it may only contain alphanumeric characters, hyphens, underscores and periods.

Here's an example which refers an existing JavaScript listener function.

In case your server is configured to run WS container on a different TCP port than the HTTP container, then you can use the optional javax.faces.WEBSOCKET_ENDPOINT_PORT integer context parameter in web.xml to explicitly specify the port.

javax.faces.WEBSOCKET_ENDPOINT_PORT8000

When successfully connected, the web socket is by default open as long as the document is open, and it will auto-reconnect at increasing intervals when the connection is closed/aborted as result of e.g. a network error or server restart. It will not auto-reconnect when the very first connection attempt already fails. The web socket will be implicitly closed once the document is unloaded.

In WAR side, you can inject PushContext via @Push annotation on the given channel name in any CDI/container managed artifact such as @Named, @WebServlet, etc wherever you'd like to send a push message and then invoke PushContext.send(Object) with any Java object representing the push message.

By default the name of the channel is taken from the name of the variable into which injection takes place. The channel name can be optionally specified via the Bag Chain Dress Gradient Silver Bag Sequin Handbag Fashion Party Clutch Crossbody Dinner Banquet Ladies Bag Evening Color Bag channel attribute. The example below injects the push context for channel name foo into a variable named bar.

@Inject @Push(channel="foo")
private PushContext bar;

The message object will be encoded as JSON and be delivered as message argument of the onmessage JavaScript listener function associated with the channel name. It can be a plain vanilla String, but it can also be a collection, map and even a javabean.

Although web sockets support two-way communication, the push is designed for one-way communication, from server to client. In case you intend to send some data from client to server, continue using JSF ajax the usual way. This has among others the advantage of maintaining the JSF view state, the HTTP session and, importantingly, all security constraints on business service methods.

By default the web socket is application scoped, i.e. any view/session throughout the web application having the same web socket channel open will receive the same push message. The push message can be sent by all users and the application itself.

The optional scope attribute can be set to session to restrict the push messages to all views in the current user session only. The push message can only be sent by the user itself and not by the application.

The scope attribute can also be set to view to restrict the push messages to the current view only. The push message will not show up in other views in the same session even if it's the same URL. The push message can only be sent by the user itself and not by the application.

The scope attribute may not be an EL expression and allowed values are application, session and view, case insensitive.

Additionally, the optional user attribute can be set to the unique identifier of the logged-in user, usually the login name or the user ID. This way the push message can be targeted to a specific user and can also be sent by other users and the application itself. The value of the user attribute must at least implement Serializable and have a low memory footprint, so putting entire user entity is not recommended.

E.g. when you're using container managed authentication or a related framework/library:

Or when you have a custom user entity around in EL as #{someLoggedInUser} which has an id property representing its identifier:

You can use the optional connected attribute to control whether to auto-connect the web socket or not.

It defaults to true and it's under the covers interpreted as a JavaScript instruction whether to open or close the web socket push connection. If the value is an EL expression and it becomes false during an ajax request, then the push connection will explicitly be closed during oncomplete of that ajax request.

You can also explicitly set it to false and manually open the push connection in client side by invoking jsf.push.open(clientId), passing the component's client ID.

In case you intend to have an one-time push and don't expect more messages, you can optionally explicitly close the push connection from client side by invoking jsf.push.close(clientId), passing the component's client ID. For example, in the onmessage JavaScript listener function as below:

The optional onopen JavaScript listener function can be used to listen on open of a web socket in client side. This will be invoked on the very first connection attempt, regardless of whether it will be successful or not. This will not be invoked when the web socket auto-reconnects a broken connection after the first successful connection.

The onopen JavaScript listener function will be invoked with one argument:

channel: the channel name, useful in case you intend to have a global listener.

The optional Silver Bag Dress Ladies Chain Evening Clutch Bag Fashion Party Gradient Bag Color Bag Banquet Handbag Crossbody Dinner Sequin onclose JavaScript listener function can be used to listen on (ab)normal close of a web socket. This will be invoked when the very first connection attempt fails, or the server has returned close reason code 1000 (normal closure) or 1008Credit CH00007532 Business Wallet Azeeda Holder Card Card 'Cloud' Azeeda 'Cloud' xT1wZzqHY (policy violated), or the maximum reconnect attempts has exceeded. This will not be invoked when the web socket can make an auto-reconnect attempt on a broken connection after the first successful connection.

When a session or view scoped socket is automatically closed with close reason code 1000 by the server (and thus not manually by the client via jsf.push.close(clientId)), then it means that the session or view has expired.

If the socket is declared in a page which is only restricted to logged-in users with a specific role, then you may want to add the URL of the push handshake request URL to the set of restricted URLs.

The push handshake request URL is composed of the URI prefix /javax.faces.push/, followed by channel name. So, in case of for example container managed security which has already restricted an example page /user/foo.xhtml to logged-in users with the example role USER on the example URL pattern /user/* in web.xml like below,

Restrict access to role USER./user/*USER

.. and the page /user/foo.xhtml in turn contains a , then you need to add a restriction on push handshake request URL pattern of /javax.faces.push/foo like below.

Restrict access to role USER./user/*/javax.faces.push/fooUSER

As extra security, particularly for those public channels which can't be restricted by security constraints, the will register all so far declared channels in the current HTTP session, and any incoming web socket open request will be checked whether they match the so far registered channels in the current HTTP session. In case the channel is unknown (e.g. randomly guessed or spoofed by endusers or manually reconnected after the session is expired), then the web socket will immediately be closed with close reason code CloseReason.CloseCodes.VIOLATED_POLICY (1008). Also, when the HTTP session gets destroyed, all session and view scoped channels which are still open will explicitly be closed from server side with close reason code CloseReason.CloseCodes.NORMAL_CLOSURE (1000). Only application scoped sockets remain open and are still reachable from server end even when the session or view associated with the page in client side is expired.

Size: 17*5*13cm,This bag is very roomy enough to store 4.7 inch cell phones, lipstick and other small stuff.

Synthetic

Cross-Body Bags, Clutches

1 detachable chain for use on the shoulder or as a handheld bag.

Occasion: The evening bags for women designed for use during special occasions and with more formal clothing. They are perfect for Evening Party,Prom,Ball,Banquet,Cocktail,Wedding,Family reunion,Date nights or nights out on the town.

Every woman longs to have her own evening bag, this little bag very classy will get lot off use out off this. It is perfect gift for birthday, Christmas and new year to your families and friends.