counter.xhtml
Code: Select all
<p:socket onMessage="handleMessage" channel="/counter" />
Code: Select all
PushContext pushContext = PushContextFactory.getDefault().getPushContext();
pushContext.push("/counter", String.valueOf(count));
Code: Select all
<p:socket onMessage="handleMessage" channel="/counter" />
Code: Select all
PushContext pushContext = PushContextFactory.getDefault().getPushContext();
pushContext.push("/counter", String.valueOf(count));
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<!-- Atmosphere Servlet -->
<servlet>
<description>AtmosphereServlet</description>
<servlet-name>AtmosphereServlet</servlet-name>
<servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class>
<!-- If you want to use Servlet 3.0 -->
<async-supported>true</async-supported>
<!-- List of init-param -->
</servlet>
<servlet-mapping>
<servlet-name>AtmosphereServlet</servlet-name>
<!-- Any mapping -->
<url-pattern>/*</url-pattern>
</servlet-mapping>
<context-param>
<param-name>primefaces.PUSH_SERVER_URL</param-name>
<param-value>http://localhost:8080</param-value>
</context-param>
</web-app>
"NetworkError: 404 Not Found - http://localhost:8080/LB2-InfoSys-ui-we ... che-Date=0"
Firefox can't establish a connection to the server at ws://localhost:8080/LB2-InfoSys-ui-web/primepush/counter?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=1.0&X-Atmosphere-Transport=websocket&X-Cache-Date=0.
...dyState==3&&ak.status==200&&aj.transport!="long-polling"){ao=true}else{clearTime...
Websocket closed, reason: Connection was closed abnormally (that is, with no close frame being sent).
Websocket closed, wasClean: false
Websocket failed. Downgrading to Comet and resending
GET http://localhost:8080/LB2-InfoSys-ui-we ... 6077127655
"NetworkError: 404 Not Found - http://localhost:8080/LB2-InfoSys-ui-we ... 6077127655"
SyntaxError: JSON.parse: unexpected character
...this,e)})},prop:function(e,bY){return bF.access(this,bF.prop,e,bY,arguments.leng...
Users browsing this forum: No registered users and 21 guests