Commit 7f90f17e authored by 冯景珉's avatar 冯景珉

Updates 框架功能描述/websocket.md

Auto commit by GitBook Editor
parent abd835dd
# 使用websocket实现消息提示 # 使用websocket实现消息提示
### 1、进行websocket的相应配置 ### 1、进行websocket的相应配置
* js所在目录:webapp/lib/websocket/sockjs.js #### 添加需要的文件
* spring配置所在目录:resources/spring/applicationContext-websocket.xml * js:webapp/lib/websocket/sockjs.js
* spring配置文件:resources/spring/applicationContext-websocket.xml
#### 配置websocket的拦截器与连接Handler
<bean id="websocket" class="com.hand.hap.message.websocket.DefaultWebSocketHandler"/>
<bean class="com.hand.hap.message.websocket.WebSocketSessionManager"/>
<bean class="com.hand.hap.message.websocket.BadgeManager"/>
<websocket:handlers>
<websocket:mapping path="/websocket" handler="websocket"/>
<websocket:handshake-interceptors>
<bean class="com.hand.hap.message.websocket.WebSocketHandshakeInterceptor"/>
</websocket:handshake-interceptors>
<websocket:sockjs/>
</websocket:handlers>
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