Jsf 2 Can';不要使用素数
我尝试在一个对话框中使用p:push,我在chrome中遇到了这个错误:Jsf 2 Can';不要使用素数,jsf-2,primefaces,myfaces,Jsf 2,Primefaces,Myfaces,我尝试在一个对话框中使用p:push,我在chrome中遇到了这个错误: Uncaught Error: INVALID_STATE_ERR: DOM Exception 11 primefaces.js.xhtml:1 PrimeFaces.widget.PrimeWebSocket.send primefaces.js.xhtml:1 PrimeFaces.ajax.AjaxUtils.handleResponse primefaces.js.xhtml:1 Prim
Uncaught Error: INVALID_STATE_ERR: DOM Exception 11 primefaces.js.xhtml:1
PrimeFaces.widget.PrimeWebSocket.send primefaces.js.xhtml:1
PrimeFaces.ajax.AjaxUtils.handleResponse primefaces.js.xhtml:1
PrimeFaces.ajax.AjaxResponse primefaces.js.xhtml:1
k.success primefaces.js.xhtml:1
b.Callbacks.bv jquery.js.xhtml:16
b.Callbacks.bE.fireWith jquery.js.xhtml:16
bF jquery.js.xhtml:23
b.ajaxTransport.send.bv
推送服务器正在jetty 8.1.5.v20120716端口9090处运行
这是我的应用程序的web.xml的一部分:
<context-param>
<param-name>primefaces.PUSH_SERVER_URL</param-name>
<param-value>ws://localhost:9090/push/</param-value>
</context-param>
最后是尝试推送的代码:
public void abrir() {
...
modeloPopup.setContext(RequestContext.getCurrentInstance());
modeloPopup.getContext().push("importador", 0);
}
我做错什么了吗
增加
如果有用的话,这是我的push服务器的pom.xml
<parent>
<artifactId>modulos-web</artifactId>
<groupId>com.hrgi.web</groupId>
<version>0.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>push-server</artifactId>
<packaging>war</packaging>
<name>push-server</name>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-websocket</artifactId>
<version>8.1.5.v20120716</version>
</dependency>
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-runtime</artifactId>
<version>1.0.1</version>
</dependency>
</dependencies>
<build>
<finalName>push-server</finalName>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.5.v20120716</version>
<configuration>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>9090</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
</configuration>
</plugin>
</plugins>
</build>
模网
com.hrgi.web
0.1.0
4.0.0
推送服务器
战争
推送服务器
org.eclipse.jetty
码头腹板箱
8.1.5.v20120716
组织气氛
大气运行时间
1.0.1
推送服务器
org.mortbay.jetty
jetty maven插件
8.1.5.v20120716
9090
60000
您需要以下设置才能进行推送
在pom.xml中:
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-runtime</artifactId>
<version>1.0.0.RC1</version>
</dependency>
组织气氛
大气运行时间
1.0.0.RC1
在web.xml中,推送servlet设置:
<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>
推送Servlet
org.primefaces.push.PushServlet
推送Servlet
/primepush/*
在这些之后,推动必须起作用
您可以查看primefaces\u user\u quide dowument以了解更多完整的信息当前的primefaces 3.x用户指南说明了完全不同的内容。也许您使用的是旧的PrimeFaces 2.x?不,我使用的是PrimeFaces 3.4,我从用户指南中复制了答案。到目前为止,我不需要使用push,所以我不知道用户指南是否正确或过期。我已经再次下载了用户指南,我看不出有什么不同。除非您使用的是付费版本,并且免费版本中没有提及某些内容;)请看这一部分:5。我相信你是对的。这在3.4.1(几周前发布)中显然发生了变化。3.4没有提到这一点。然而,我不明白这如何回答OP的具体问题。
<parent>
<artifactId>modulos-web</artifactId>
<groupId>com.hrgi.web</groupId>
<version>0.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>push-server</artifactId>
<packaging>war</packaging>
<name>push-server</name>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-websocket</artifactId>
<version>8.1.5.v20120716</version>
</dependency>
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-runtime</artifactId>
<version>1.0.1</version>
</dependency>
</dependencies>
<build>
<finalName>push-server</finalName>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.5.v20120716</version>
<configuration>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>9090</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
</configuration>
</plugin>
</plugins>
</build>
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-runtime</artifactId>
<version>1.0.0.RC1</version>
</dependency>
<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>