O'Reilly logo

Developing Middleware in Java EE 8 by Abdalla Mahmoud

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Server-sent events

The classic model of HTTP communication is the single-request-response model: the client issues a request to the server, the server sends a response, the connection gets closed, that's all! Each HTTP connection serves exactly one response.

In some scenarios, the opposite of this model is required—the server sends some data to the client, without a special request from the client. This is very common in notification systems, such as social media notification pop-ups, or in applications such as chatting. When the client has a new notification or a chatting message, the server should redirect it to the client.

It is technically impossible for the server to initiate a connection to the client; therefore, some techniques were ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required