Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hel-developer-guide
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hel-guide
hel-developer-guide
Commits
7f90f17e
Commit
7f90f17e
authored
Jan 25, 2018
by
冯景珉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates 框架功能描述/websocket.md
Auto commit by GitBook Editor
parent
abd835dd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
websocket.md
框架功能描述/websocket.md
+19
-2
No files found.
框架功能描述/websocket.md
View file @
7f90f17e
# 使用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>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment