Java EE 7 (including JAX-RS and Web Socket ) and plain HTML5 and JavaScript
- Implement the REST service to handle json payloads in HTTP Post requests
- Implement the WebSocket endpoint
- Interact from REST service endpoint with WebSocket (endpoint)
- Implement the HTML and JavaScript web application to present the live status for the movie theater based on the web socket messages
浏览器访问:http://localhost:8080/learn-websocket/websocket-client.html
curl -i -X POST -H "Content-Type:application/json" -d '{"room":"2","occupation":"12"}' http://localhost:8080/learn-websocket/rest/cinemaevent
// servlet 中模拟了 json 数据
curl -i -X POST -H "Content-Type:application/json" -d '{"room":"2","occupation":"12"}' http://localhost:8080/learn-websocket/servlet