Commit 3ded3cb0 authored by 冯景珉's avatar 冯景珉

Updates 框架功能描述/websocket.md

Auto commit by GitBook Editor
parent fc1d1881
...@@ -27,6 +27,23 @@ ...@@ -27,6 +27,23 @@
* mapping中的path表示websocket的连接路径。
* handler是用于连接的类,必须要实现。
* interceptors可以对websocket连接进行拦截,在握手前后进行方法调用。
####前端打开websocket连接
```
function initWebSocket() {
socket = new SockJS(contextPath + '/websocket');
socket.onmessage = function (event) {
var data = $.parseJSON(event.data);//获取推送到前端的消息
}
};
```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment