Java servlet and server sent events

前端 未结 3 1105
醉酒成梦
醉酒成梦 2020-12-14 21:41

Is it possible to create a server sent event using java servlets so that a client could receive updates using:

 

        
3条回答
  •  我在风中等你
    2020-12-14 22:06

    Server-Sent Events is a HTML5 feature. We say "HTML5", therefore it's just client side feature. So long server can set https respnse header "text/event-stream;charset=UTF-8","Connection", "keep-alive", then it is supported by server. You can set such header with Java Servlet. Here you can find a step for step guide on SSE with servlet

提交回复
热议问题