Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Server Sent Events on Play framework using Java

I am completely new Play framework and Scala. I am trying to push some events from the server to the browser using Html5 -server sent events and play framework.

I came across this example in Scala. I tried implementing action composition in java by extending play.mvc.Action.Simple. I am not sure how to set the response headers in the action composition.

http://benquasmalltalk.blogspot.fr/2012/04/hub-interesting-but-undocumented.html

The data I am sending is coming from a database and not an enumeration. Any pointers will be helpful

like image 607
Yeshvanthni Avatar asked Nov 13 '22 04:11

Yeshvanthni


1 Answers

I did this by using the websocket example: websocket-chat

And for action composite (in java), have a look here

like image 144
myborobudur Avatar answered Nov 16 '22 03:11

myborobudur