1

我正在尝试实现 primefaces 展示中给出的基本反例。当我在 Eclipse 上运行应用程序时,每次单击后计数器似乎都会增加。但在 Firefox 和 Google Chrome 上,增加的值仅在刷新后显示(不是推送)。我也收到类似
org.atmosphere.cpr.AtmosphereFramework - Failed using comet support: org.atmosphere.container.Tomcat7AsyncSupportWithWebSocket, error: Tomcat failed to detect this is a Comet application because context.xml is missing or the Http11NioProtocol Connector is启用。

context.xml 有什么作用?它应该包含什么?

4

1 回答 1

1

您应该在 server.xml 中像这样更改连接器协议:

  <Service name="Catalina">
  <!--    
    <Connector port="8080" address="xxx.xxx.xxx.xxx" protocol="HTTP/1.1" ..../>
  -->
  <!-- 
    HTTP 1.1 protocol is replaced with org.apache.coyote.http11.Http11NioProtocol 
  -->
  <Connector port="8080" address="xxx.xxx.xxx.xxx" protocol="org.apache.coyote.http11.Http11NioProtocol" />
  ...
  </Service>
于 2013-03-21T13:19:59.593 回答