Enable Instant Messaging with the HTML5 WebSocket API

Source: Internet
Author: User

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

Description

This project demonstrates how to use the HTML5 WebSocket API to enable Instant Messaging functionality.
This project encoding method: UTF-8
Function Description:
1. This function supports multi-person chatting;
2, someone on-line or offline, the session window to realize their own active display;
3. Support shortcut key close the session form or send session information.
Environmental requirements:
1, Tomcat requires more than 7.0 of the version number
Attention:
Suppose 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 is" http://server computer ip:port/websocket/"when asked.

Failure and Workaround:
JAVA.LANG.NOSUCHMETHODEXCEPTION:ORG.APACHE.CATALINA.DEPLOY.WEBXML Addservlet
Workaround: Add <loader delegate= "true"/> to the context tag 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 directory in the Tomcat installation directory 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 directory are copied to the Lib directory in the Tomcat installation directory.

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.