What will be the best way to push data from server side to client, while client is a web browser.
My server side is build in java, and client side is on html, js, ajax.
Mode of communication is HTTP protocol.
The server sends messages to the client using event stream format, a simple stream of text data that is encoded using UTF-8. Once contact has been established, the HTTP connection is kept open for the given message stream, so that the server can send updates.
To pass the value of client side, you can use javascript to pass that value to a <asp:HiddenField > first, then do a post back. At the server side you can retrive the value.
You can use web-sockets which are two way communication between client and server that remain open and allow the server to send without request from the client. However web-sockets are new and browser support is only for the most current browsers.
WebSockets is the "real" way to do it. WebSockets
Java Implementation Atmosphere
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With