Enable Instant Messaging with the HTML5 WebSocket API

Source: Internet
Author: User

Project: http://download.csdn.net/detail/wangshuxuncom/6430191

Description

This project shows you how to use the HTML5 WebSocket API to realize instant messaging capabilities.
Coding method of this project: UTF-8
Function Description:
1. This function supports multi-person chatting;
2, when someone online or offline, the session window will automatically display;
3. Support shortcut key Close Session window or send session information.
Environmental requirements:
1, Tomcat requires more than 7.0 of the version
Attention:
If you want to test on more than one computer, you need to change "ws://localhost:8080/websocket/sendmessage" in the Websocket.js file to "ws://server computer IP: Port/websocket/ SendMessage "http on Access is"//server computer IP: Port/websocket/".

Problems and Workarounds:
JAVA.LANG.NOSUCHMETHODEXCEPTION:ORG.APACHE.CATALINA.DEPLOY.WEBXML Addservlet
Workaround: Add <loader delegate= "true"/> In the Context tab in the Tomcat installation file Context.xml to resolve the issue.


Java.lang.NoSuchMethodError:org.apache.catalina.connector.RequestFacade.doUpgrade (lorg/apache/coyote/http11/ Upgrade/upgradeinbound;) V
Workaround: Locate the Lib folder in the Tomcat installation folder and delete the two jar files named "Catalina.jar" and "Tomcat-coyote.jar" in this project webroot-->web-inf--> The two jar files named "Catalina.jar" and "Tomcat-coyote.jar" in the Lib folder are copied to the Lib folder in the Tomcat installation folder.

Enable Instant Messaging with the HTML5 WebSocket API

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.