websocket前端页面与后台交互的例子

上传者: ljk168 | 上传时间: 2021-04-28 11:04:43 | 文件大小: 98KB | 文件类型: ZIP
websocket前端页面与后台交互的例子,解压文件后,用idea导入项目,启动WebsocketServer类,接着用浏览器打开websocket.html页面,会看到建立连接,然后在发送框输入{"id":"1","type":"yes"},返回666,输入其他信息会提示相应信息

文件下载

资源详情

[{"title":"( 71 个子文件 98KB ) websocket前端页面与后台交互的例子","children":[{"title":"websocket","children":[{"title":"pom.xml <span style='color:#111;'> 1.75KB </span>","children":null,"spread":false},{"title":"target","children":[{"title":"test-classes","children":[{"title":"com","children":[{"title":"pidandan","children":[{"title":"websocket","children":[{"title":"WebsocketApplicationTests.class <span style='color:#111;'> 649B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"generated-test-sources","children":[{"title":"test-annotations","children":null,"spread":false}],"spread":true},{"title":"classes","children":[{"title":"application.properties <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"com","children":[{"title":"pidandan","children":[{"title":"websocket","children":[{"title":"eg2","children":[{"title":"Constant.class <span style='color:#111;'> 875B </span>","children":null,"spread":false},{"title":"MyWebSocketHandler.class <span style='color:#111;'> 7.99KB </span>","children":null,"spread":false},{"title":"BaseWebSocketServerHandler.class <span style='color:#111;'> 1.65KB </span>","children":null,"spread":false}],"spread":true},{"title":"WebsocketApplication.class <span style='color:#111;'> 730B </span>","children":null,"spread":false},{"title":"netty","children":[{"title":"WebsocketServer.class <span style='color:#111;'> 2.10KB </span>","children":null,"spread":false},{"title":"WebSocketChannelInitializer.class <span style='color:#111;'> 1.68KB </span>","children":null,"spread":false},{"title":"WebSocketHandler.class <span style='color:#111;'> 2.60KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"generated-sources","children":[{"title":"annotations","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"mvnw <span style='color:#111;'> 8.90KB </span>","children":null,"spread":false},{"title":"websocket.iml <span style='color:#111;'> 5.20KB </span>","children":null,"spread":false},{"title":"src","children":[{"title":"test","children":[{"title":"java","children":[{"title":"com","children":[{"title":"pidandan","children":[{"title":"websocket","children":[{"title":"WebsocketApplicationTests.java <span style='color:#111;'> 343B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"main","children":[{"title":"resources","children":[{"title":"application.properties <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":true},{"title":"java","children":[{"title":"com","children":[{"title":"pidandan","children":[{"title":"websocket","children":[{"title":"eg2","children":[{"title":"Constant.java <span style='color:#111;'> 722B </span>","children":null,"spread":false},{"title":"BaseWebSocketServerHandler.java <span style='color:#111;'> 1.44KB </span>","children":null,"spread":false},{"title":"MyWebSocketHandler.java <span style='color:#111;'> 6.18KB </span>","children":null,"spread":false}],"spread":true},{"title":"netty","children":[{"title":"WebsocketServer.java <span style='color:#111;'> 1.21KB </span>","children":null,"spread":false},{"title":"WebSocketChannelInitializer.java <span style='color:#111;'> 1.65KB </span>","children":null,"spread":false},{"title":"WebSocketHandler.java <span style='color:#111;'> 1.26KB </span>","children":null,"spread":false}],"spread":false},{"title":"WebsocketApplication.java <span style='color:#111;'> 322B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":".idea","children":[{"title":"uiDesigner.xml <span style='color:#111;'> 8.59KB </span>","children":null,"spread":false},{"title":"misc.xml <span style='color:#111;'> 439B </span>","children":null,"spread":false},{"title":"modules.xml <span style='color:#111;'> 258B </span>","children":null,"spread":false},{"title":"encodings.xml <span style='color:#111;'> 172B </span>","children":null,"spread":false},{"title":"compiler.xml <span style='color:#111;'> 630B </span>","children":null,"spread":false},{"title":"workspace.xml <span style='color:#111;'> 34.27KB </span>","children":null,"spread":false},{"title":"libraries","children":[{"title":"Maven__org_apache_logging_log4j_log4j_to_slf4j_2_11_1.xml <span style='color:#111;'> 632B </span>","children":null,"spread":false},{"title":"Maven__org_springframework_boot_spring_boot_2_1_1_RELEASE.xml <span style='color:#111;'> 660B </span>","children":null,"spread":false},{"title":"Maven__ch_qos_logback_logback_classic_1_2_3.xml <span style='color:#111;'> 592B </span>","children":null,"spread":false},{"title":"Maven__org_ow2_asm_asm_5_0_4.xml <span style='color:#111;'> 496B </span>","children":null,"spread":false},{"title":"Maven__org_objenesis_objenesis_2_6.xml <span style='color:#111;'> 532B </span>","children":null,"spread":false},{"title":"Maven__org_springframework_spring_aop_5_1_3_RELEASE.xml <span style='color:#111;'> 633B </span>","children":null,"spread":false},{"title":"Maven__javax_annotation_javax_annotation_api_1_3_2.xml <span style='color:#111;'> 635B </span>","children":null,"spread":false},{"title":"Maven__net_bytebuddy_byte_buddy_agent_1_9_5.xml <span style='color:#111;'> 595B </span>","children":null,"spread":false},{"title":"Maven__junit_junit_4_12.xml <span style='color:#111;'> 479B </span>","children":null,"spread":false},{"title":"Maven__net_bytebuddy_byte_buddy_1_9_5.xml <span style='color:#111;'> 553B </span>","children":null,"spread":false},{"title":"Maven__org_yaml_snakeyaml_1_23.xml <span style='color:#111;'> 519B </span>","children":null,"spread":false},{"title":"Maven__org_hamcrest_hamcrest_library_1_3.xml <span style='color:#111;'> 577B </span>","children":null,"spread":false},{"title":"Maven__org_springframework_boot_spring_boot_autoconfigure_2_1_1_RELEASE.xml <span style='color:#111;'> 758B </span>","children":null,"spread":false},{"title":"Maven__org_apache_logging_log4j_log4j_api_2_11_1.xml <span style='color:#111;'> 597B </span>","children":null,"spread":false},{"title":"Maven__org_springframework_boot_spring_boot_starter_logging_2_1_1_RELEASE.xml <span style='color:#111;'> 772B </span>","children":null,"spread":false},{"title":"Maven__ch_qos_logback_logback_core_1_2_3.xml <span style='color:#111;'> 571B </span>","children":null,"spread":false},{"title":"Maven__org_springframework_spring_test_5_1_3_RELEASE.xml <span style='color:#111;'> 640B </span>","children":null,"spread":false},{"title":"Maven__org_assertj_assertj_core_3_11_1.xml <span style='color:#111;'> 566B </span>","children":null,"spread":false},{"title":"Maven__org_springframework_spring_context_5_1_3_RELEASE.xml <span style='color:#111;'> 661B </span>","children":null,"spread":false},{"title":"Maven__org_springframework_boot_spring_boot_starter_test_2_1_1_RELEASE.xml <span style='color:#111;'> 751B </span>","children":null,"spread":false},{"title":"Maven__org_slf4j_slf4j_api_1_7_25.xml <span style='color:#111;'> 537B </span>","children":null,"spread":false},{"title":"Maven__org_hamcrest_hamcrest_core_1_3.xml <span style='color:#111;'> 556B </span>","children":null,"spread":false},{"title":"Maven__org_slf4j_jul_to_slf4j_1_7_25.xml <span style='color:#111;'> 558B </span>","children":null,"spread":false},{"title":"Maven__com_jayway_jsonpath_json_path_2_4_0.xml <span style='color:#111;'> 570B </span>","children":null,"spread":false},{"title":"Maven__org_springframework_spring_beans_5_1_3_RELEASE.xml <span style='color:#111;'> 647B </span>","children":null,"spread":false},{"title":"Maven__org_mockito_mockito_core_2_23_4.xml <span style='color:#111;'> 566B </span>","children":null,"spread":false},{"title":"Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml <span style='color:#111;'> 724B </span>","children":null,"spread":false},{"title":"Maven__org_skyscreamer_jsonassert_1_5_0.xml <span style='color:#111;'> 561B </span>","children":null,"spread":false},{"title":"Maven__org_springframework_boot_spring_boot_test_2_1_1_RELEASE.xml <span style='color:#111;'> 695B </span>","children":null,"spread":false},{"title":"Maven__com_alibaba_fastjson_1_2_50.xml <span style='color:#111;'> 538B </span>","children":null,"spread":false},{"title":"Maven__org_xmlunit_xmlunit_core_2_6_2.xml <span style='color:#111;'> 559B </span>","children":null,"spread":false},{"title":"Maven__net_minidev_json_smart_2_3.xml <span style='color:#111;'> 531B </span>","children":null,"spread":false},{"title":"Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_1_1_RELEASE.xml <span style='color:#111;'> 793B </span>","children":null,"spread":false},{"title":"Maven__org_springframework_boot_spring_boot_starter_2_1_1_RELEASE.xml <span style='color:#111;'> 716B </span>","children":null,"spread":false},{"title":"Maven__org_springframework_spring_jcl_5_1_3_RELEASE.xml <span style='color:#111;'> 633B </span>","children":null,"spread":false},{"title":"Maven__net_minidev_accessors_smart_1_2.xml <span style='color:#111;'> 566B </span>","children":null,"spread":false},{"title":"Maven__org_springframework_spring_core_5_1_3_RELEASE.xml <span style='color:#111;'> 640B </span>","children":null,"spread":false},{"title":"Maven__org_springframework_spring_expression_5_1_3_RELEASE.xml <span style='color:#111;'> 682B </span>","children":null,"spread":false},{"title":"Maven__io_netty_netty_all_4_1_6_Final.xml <span style='color:#111;'> 568B </span>","children":null,"spread":false}],"spread":false},{"title":"inspectionProfiles","children":null,"spread":false}],"spread":true},{"title":".gitignore <span style='color:#111;'> 268B </span>","children":null,"spread":false},{"title":".mvn","children":[{"title":"wrapper","children":[{"title":"maven-wrapper.jar <span style='color:#111;'> 47.20KB </span>","children":null,"spread":false},{"title":"maven-wrapper.properties <span style='color:#111;'> 116B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"mvnw.cmd <span style='color:#111;'> 5.67KB </span>","children":null,"spread":false}],"spread":true},{"title":"websocket.html <span style='color:#111;'> 2.16KB </span>","children":null,"spread":false}],"spread":true}]

评论信息

  • bonlog :
    不能使用,但,太单一,只能一对一,无法一对多
    2021-06-29

免责申明

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