基于spring websocket实现广播及点对点推送功能Demo

上传者: chenjhit | 上传时间: 2019-12-21 18:48:34 | 文件大小: 6.82MB | 文件类型: zip
基于spring websocket实现广播及点对点推送功能Demo。 开发环境:IntelliJ IDEA 2016.3.4 运行环境:jre1.8.0_131 服务器:Tomcat 8.5 测试步骤: 1.配置好环境,主要是maven和tomcat; 2.编译并运行,使用不同的浏览器分别进行连接; 3.将不同浏览器“控制台”或者“console”监听的/user/**/message中**作为ID填入输入框; 4.点击“Send”,发现只有ID匹配的浏览器才会接收到消息,到此点对点测试完成; 5.在任意浏览器中打开新的浏览页,访问localhost:8080/send,在所有连接的客户端均受到消息,到此广播测试完成。

文件下载

资源详情

[{"title":"( 66 个子文件 6.82MB ) 基于spring websocket实现广播及点对点推送功能Demo","children":[{"title":"HelloWeb","children":[{"title":"src","children":[{"title":"test","children":[{"title":"java","children":null,"spread":false}],"spread":true},{"title":"main","children":[{"title":"web","children":null,"spread":false},{"title":"resources","children":[{"title":"config","children":[{"title":"spring","children":[{"title":"dispatcher.xml <span style='color:#111;'> 1.15KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"java","children":[{"title":"com","children":[{"title":"model","children":[{"title":"Greeting.java <span style='color:#111;'> 225B </span>","children":null,"spread":false},{"title":"HelloMessage.java <span style='color:#111;'> 142B </span>","children":null,"spread":false}],"spread":true},{"title":"controller","children":[{"title":"GreetingController.java <span style='color:#111;'> 3.08KB </span>","children":null,"spread":false}],"spread":true},{"title":"websocket","children":[{"title":"WebSocketConfig.java <span style='color:#111;'> 1.99KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"target","children":[{"title":"generated-sources","children":[{"title":"annotations","children":null,"spread":false}],"spread":true},{"title":"classes","children":[{"title":"com","children":[{"title":"model","children":[{"title":"HelloMessage.class <span style='color:#111;'> 421B </span>","children":null,"spread":false},{"title":"Greeting.class <span style='color:#111;'> 462B </span>","children":null,"spread":false}],"spread":true},{"title":"controller","children":[{"title":"GreetingController.class <span style='color:#111;'> 3.20KB </span>","children":null,"spread":false}],"spread":true},{"title":"websocket","children":[{"title":"WebSocketConfig.class <span style='color:#111;'> 2.06KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"config","children":[{"title":"spring","children":[{"title":"dispatcher.xml <span style='color:#111;'> 1.15KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":".idea","children":[{"title":"artifacts","children":[{"title":"HelloWeb_war_exploded.xml <span style='color:#111;'> 2.31KB </span>","children":null,"spread":false}],"spread":true},{"title":"libraries","children":[{"title":"Maven__org_springframework_spring_web_4_2_8_RELEASE.xml <span style='color:#111;'> 633B </span>","children":null,"spread":false},{"title":"Maven__com_fasterxml_jackson_core_jackson_annotations_2_5_0.xml <span style='color:#111;'> 668B </span>","children":null,"spread":false},{"title":"Maven__com_fasterxml_jackson_core_jackson_core_2_5_3.xml <span style='color:#111;'> 619B </span>","children":null,"spread":false},{"title":"Maven__aopalliance_aopalliance_1_0.xml <span style='color:#111;'> 538B </span>","children":null,"spread":false},{"title":"Maven__org_springframework_spring_messaging_4_2_8_RELEASE.xml <span style='color:#111;'> 675B </span>","children":null,"spread":false},{"title":"Maven__javax_servlet_javax_servlet_api_3_1_0.xml <span style='color:#111;'> 602B </span>","children":null,"spread":false},{"title":"Maven__com_fasterxml_jackson_core_jackson_databind_2_5_3.xml <span style='color:#111;'> 647B </span>","children":null,"spread":false},{"title":"Maven__org_springframework_spring_context_support_4_2_8_RELEASE.xml <span style='color:#111;'> 717B </span>","children":null,"spread":false},{"title":"Maven__org_springframework_spring_expression_4_2_8_RELEASE.xml <span style='color:#111;'> 682B </span>","children":null,"spread":false},{"title":"Maven__commons_logging_commons_logging_1_2.xml <span style='color:#111;'> 582B </span>","children":null,"spread":false},{"title":"Maven__org_springframework_spring_beans_4_2_8_RELEASE.xml <span style='color:#111;'> 647B </span>","children":null,"spread":false},{"title":"Maven__org_springframework_spring_context_4_2_8_RELEASE.xml <span style='color:#111;'> 661B </span>","children":null,"spread":false},{"title":"Maven__org_springframework_spring_core_4_2_8_RELEASE.xml <span style='color:#111;'> 640B </span>","children":null,"spread":false},{"title":"Maven__org_springframework_spring_aop_4_2_8_RELEASE.xml <span style='color:#111;'> 633B </span>","children":null,"spread":false},{"title":"Maven__org_springframework_spring_websocket_4_2_8_RELEASE.xml <span style='color:#111;'> 675B </span>","children":null,"spread":false},{"title":"Maven__org_springframework_spring_webmvc_4_2_8_RELEASE.xml <span style='color:#111;'> 654B </span>","children":null,"spread":false}],"spread":false},{"title":"misc.xml <span style='color:#111;'> 454B </span>","children":null,"spread":false},{"title":"compiler.xml <span style='color:#111;'> 628B </span>","children":null,"spread":false},{"title":"workspace.xml <span style='color:#111;'> 66.12KB </span>","children":null,"spread":false},{"title":"modules.xml <span style='color:#111;'> 256B </span>","children":null,"spread":false}],"spread":true},{"title":"web","children":[{"title":"WEB-INF","children":[{"title":"web.xml <span style='color:#111;'> 1.85KB </span>","children":null,"spread":false}],"spread":true},{"title":"js","children":[{"title":"sockjs.js <span style='color:#111;'> 176.32KB </span>","children":null,"spread":false},{"title":"stomp.js <span style='color:#111;'> 15.84KB </span>","children":null,"spread":false},{"title":"jquery-3.2.1.min.js <span style='color:#111;'> 84.63KB </span>","children":null,"spread":false}],"spread":true},{"title":"websocket.html <span style='color:#111;'> 4.21KB </span>","children":null,"spread":false}],"spread":true},{"title":"README.txt <span style='color:#111;'> 443B </span>","children":null,"spread":false},{"title":"HelloWeb.iml <span style='color:#111;'> 3.11KB </span>","children":null,"spread":false},{"title":"pom.xml <span style='color:#111;'> 2.75KB </span>","children":null,"spread":false},{"title":"out","children":[{"title":"artifacts","children":[{"title":"HelloWeb_war_exploded","children":[{"title":"WEB-INF","children":[{"title":"classes","children":[{"title":"model","children":null,"spread":false},{"title":"controller","children":null,"spread":false},{"title":"websocket","children":null,"spread":false},{"title":"com","children":[{"title":"model","children":[{"title":"HelloMessage.class <span style='color:#111;'> 421B </span>","children":null,"spread":false},{"title":"Greeting.class <span style='color:#111;'> 462B </span>","children":null,"spread":false}],"spread":false},{"title":"controller","children":[{"title":"GreetingController.class <span style='color:#111;'> 3.20KB </span>","children":null,"spread":false}],"spread":false},{"title":"websocket","children":[{"title":"WebSocketConfig.class <span style='color:#111;'> 2.06KB </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"config","children":[{"title":"spring","children":[{"title":"dispatcher.xml <span style='color:#111;'> 1.15KB </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":true},{"title":"lib","children":[{"title":"jackson-core-2.5.3.jar <span style='color:#111;'> 224.61KB </span>","children":null,"spread":false},{"title":"spring-web-4.2.8.RELEASE.jar <span style='color:#111;'> 749.69KB </span>","children":null,"spread":false},{"title":"spring-core-4.2.8.RELEASE.jar <span style='color:#111;'> 1.04MB </span>","children":null,"spread":false},{"title":"spring-expression-4.2.8.RELEASE.jar <span style='color:#111;'> 256.87KB </span>","children":null,"spread":false},{"title":"spring-aop-4.2.8.RELEASE.jar <span style='color:#111;'> 362.79KB </span>","children":null,"spread":false},{"title":"spring-webmvc-4.2.8.RELEASE.jar <span style='color:#111;'> 857.29KB </span>","children":null,"spread":false},{"title":"spring-websocket-4.2.8.RELEASE.jar <span style='color:#111;'> 427.97KB </span>","children":null,"spread":false},{"title":"spring-messaging-4.2.8.RELEASE.jar <span style='color:#111;'> 367.61KB </span>","children":null,"spread":false},{"title":"spring-context-4.2.8.RELEASE.jar <span style='color:#111;'> 1.05MB </span>","children":null,"spread":false},{"title":"javax.servlet-api-3.1.0.jar <span style='color:#111;'> 93.56KB </span>","children":null,"spread":false},{"title":"jackson-databind-2.5.3.jar <span style='color:#111;'> 1.09MB </span>","children":null,"spread":false},{"title":"spring-beans-4.2.8.RELEASE.jar <span style='color:#111;'> 714.86KB </span>","children":null,"spread":false},{"title":"aopalliance-1.0.jar <span style='color:#111;'> 4.36KB </span>","children":null,"spread":false},{"title":"spring-context-support-4.2.8.RELEASE.jar <span style='color:#111;'> 172.88KB </span>","children":null,"spread":false},{"title":"commons-logging-1.2.jar <span style='color:#111;'> 60.38KB </span>","children":null,"spread":false},{"title":"jackson-annotations-2.5.0.jar <span style='color:#111;'> 38.88KB </span>","children":null,"spread":false}],"spread":false},{"title":"web.xml <span style='color:#111;'> 1.85KB </span>","children":null,"spread":false}],"spread":true},{"title":"js","children":[{"title":"sockjs.js <span style='color:#111;'> 176.32KB </span>","children":null,"spread":false},{"title":"stomp.js <span style='color:#111;'> 15.84KB </span>","children":null,"spread":false},{"title":"jquery-3.2.1.min.js <span style='color:#111;'> 84.63KB </span>","children":null,"spread":false}],"spread":true},{"title":"websocket.html <span style='color:#111;'> 4.21KB </span>","children":null,"spread":false},{"title":"META-INF","children":[{"title":"MANIFEST.MF <span style='color:#111;'> 99B </span>","children":null,"spread":false}],"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}]

评论信息

  • 不学习就淘汰QQ号2338372606 :
    能跑起来么,,这是重点
    2018-06-30
  • Miccke(煎饼) :
    谢谢支持!
    2018-04-15
  • troilisctz :
    谢谢支持!
    2018-03-19
  • 堃孑 :
    你好 请问一下 可以用jdk1.7 +tomcat7.0么 顺便能加一下我的Q么 417647934 有偿请教
    2018-02-07
  • 打酱油专业户 :
    学习中。。
    2017-12-14

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明