i have a question.
do i need a new request to get the new value of a bean attribute? I want to refresh the outputtext by push without reloading the page.
<p:outputLabel value="PushString"/><h:outputText id="out" value="#{testController.pushString}" styleClass="display" />
<p:socket onMessage="handleMessage" channel="/imageStream" />
i have a form with an outputtext which should get the text from server by primefaces push.
PushEndpoint:
@PushEndpoint("/imageStream")
public class ImagePushEndpoint{
@OnMessage(encoders = {JSONEncoder.class})
public String onMessage (String message){
System.out.println("PushEndpoint: "+message);
return message;
}
}
And in the ManagedBean the eventBus publishes the String to the endpoint:
eventBus.publish("/imageStream", pushString);
But i have to reload the page to get the new Value of the String.
My ApplicationServer is an embedded Jetty 9.3.
Do i have to configure the webappContext for primefaces push?
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-runtime</artifactId>
<version>2.4.8</version>
</dependency>
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-runtime-native</artifactId>
<version>2.4.8</version>
</dependency>