vastwelove.blogg.se

Alternative class for icefaces javascript context
Alternative class for icefaces javascript context











This is useful for user-specific feedback triggered by other users (e.g. The push message can be sent by all users and the application itself. In the server side, the push message can be targeted to the user specified in the user attribute via nd(Object, Serializable). So make sure the value is tied to at least a view scoped property in case you intend to control it during the view scope. When the user attribute is an EL expression and it changes during an ajax request, then the socket user will be actually switched, even though you did not cover the component in any ajax render/update. This can be solved by setting the scope to view, but better is to fix the logout to invalidate the HTTP session altogether. It may target previously logged-in user only. If in such case a session scoped socket is reused, undefined behavior may occur when user-targeted push message is sent. when your application allows changing a logged-in user during same HTTP session without invaliding it - which is in turn poor security practice). It can be set to view, but this is kind of unusual and should only be used if the logged-in user represented by user has a shorter lifetime than the HTTP session (e.g. When the user attribute is specified, then the scope defaults to session and cannot be set to application. function socketListener(message, channel, event) which has an id property representing its identifier: Here's an example which refers an existing JavaScript listener function (do not include the parentheses!). The channel name may not be an EL expression and it may only contain alphanumeric characters, hyphens, underscores and periods.

alternative class for icefaces javascript context

Usage (client)ĭeclare tag in the Faces view with at least a channel name and an onmessage JavaScript listener function. Lazy initialization of the endpoint via component is unfortunately not possible across all containers (yet). Configurationįirst enable the web socket endpoint by below boolean context parameter in web.xml:

alternative class for icefaces javascript context

The is an UIComponent whith opens an one-way (server to client) web socket based push connection in client side which can be reached from server side via PushContext interface injected in any CDI/container managed artifact via Push annotation.













Alternative class for icefaces javascript context