Server Push is described as a mechanism in which the server initiates a transaction to a client. This mechanism has various interesting implementations which improve the options for interaction on a website such as counter.
There are various technologies which implement mechanisms to achieve the experience of server push such as
  • Native Comet (The WebServer has API for Comet)
  • Native WebSockets (The WebServer has API for WebSocket)
  • WebSockets
  • Long-Polling
  • Http Streaming
  • JSONP
  • Server-Sent Events
All these technologies are supported in the Prime Push using Atmosphere Framework.
While implementing prime push using Web Sockets, I came across an issues with Tomcat that it is not behaving as required. After long search on Google I found that we need to open socket connection on Tomcat by replacing HTTP 1.1 protocol with org.apache.coyote.http11.Http11NioProtocol of connector in the server.xml file.
Server.xml Configuration

Implementation

Web.xml Configuration
Maven Dependencies
Counter Bean
Page.xhtml