Guide surfaces GlassFish 4.0

Will anyone succeed in using the above configuration? I am trying to use push with a growl from simple surfaces. I am using perffaces 3.5 GlassFish 4.0 and Atmosphere 2.0.0.RC5. My configuration is as follows:

<servlet> <servlet-name>Push Servlet</servlet-name> <servlet-class>org.primefaces.push.PushServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>Push Servlet</servlet-name> <url-pattern>/primepush/*</url-pattern> </servlet-mapping> 

Bean Method:

 private void assaginTreatment() { ... PushContext pushContext = PushContextFactory.getDefault().getPushContext(); pushContext.push("/notifications", facesMsg); return; } 

And finally, the xhtml file:

  <p:growl widgetVar="growl" showDetail="true" sticky="true" globalOnly="true" autoUpdate="true" /> <p:socket onMessage="handleMessage" channel="/notifications" autoConnect="true"/> <script type="text/javascript"> function handleMessage(facesmessage) { facesmessage.severity = 'info'; PF('growl').show([facesmessage]); } </script> 

The error I am getting is:

SEVERE: [http-listener-1(4)] WARN org.atmosphere.cpr.MetaBroadcaster - No Broadcaster match /notifications. Message...

+4
source share
1 answer

Atmosphere-2.0.0.RC5, Primefaces-4.0.RC1

I managed to make a workaround, which is really not very nice, but clicking on all made it work. May be enough for your use.

 pushContext.push("/*", facesMsg); 

Edit: So I did another debug and added some more logs

 if (BroadcasterFactory.getDefault() != null) { Collection<Broadcaster> list = BroadcasterFactory.getDefault().lookupAll(); for (Broadcaster b : list) { logger.warn("id={}", b.getID() ); } } 

exit:

 Info: 2013-09-17 22:43:10,010 - id=/* Info: 2013-09-17 22:43:10,010 - id=/notificationsprimepush 

finally i tried:

 pushContext.push("/notifications" + "primepush", facesMsg); 

HAVE WORKED!:)

+5
source

Source: https://habr.com/ru/post/1501829/


All Articles