ViewParam This sample demonstrates how to push data using GET instead of POST via view parameters. The value of "data" request parameter in uri is consumed by a view param and pushed using a preRenderView event.
<f:metadata>
    <f:viewParam name="data" value="#{viewParamPush.data}" />
    <f:event type="preRenderView" listener="#{viewParamPush.prerender}" />
</f:metadata>

<h:outputText id="out" value="#{viewParamPush.data}" style="font-size:16px" />

<p:socket onMessage="handleMessage" channel="/viewparam" />

<script type="text/javascript">
        function handleMessage(data) {
            $('#out').text(data);
        }
</script>
                
PrimeTek, Copyright © 2015
All rights reserved.
Running PrimeFaces-6.1-SNAPSHOT on Mojarra-2.2.8.