Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: AjaxChat: Chatting, the AJAX Way

This article presents an AJAX (Asynchronous Java and XML) project done with straight AJAX. That means this application will not be using any library or toolkit—it will just be you and JavaScript! Here we'll build ourselves a nice little multiuser, multiro

Tutorial Details:

Chat rooms have been with us for a very long time now. In fact, it is chat rooms, those gathering places where you can talk in real time with your fellow computer users, that draw many people to the Internet in the first place (email tends to be the biggest draw, but chat rooms are not too far behind for many people).

If you think about what a chat room application must require, it becomes clear that we'll need a server component. There has to be some broker in between all the chatter that deals with keeping track of the various chat rooms available, who is logged in and chatting in what room, and those types of system-level considerations. More important, though, is some arbiter of messages—a way for all the people currently chatting in a given room to see the various messages.

In a "real" chat application, such as those you might find on AOL, for instance, it is likely that the server actually pushes new messages out to the users in the room. That way, there is no delay between when someone says something and when everyone else in the room sees it.

If you were going to build a purely HTML-based chat application, as we are about to do, you'd have to consider all of these points. However, because the Web is based on a pull model of client-server interaction, ignoring things like applets and such, you clearly need to go about things a little differently. Could you have a meta refresh tag on a page that periodically asked the server for any new messages? Yes, but then you would be redrawing the entire screen each time, which would be rather inefficient, especially if you built it with something like JSP (JavaServer Pages) or another dynamic rendering technology where the server would be responsible for that redrawing.


 

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
AjaxChat: Chatting, the AJAX Way

View Tutorial:
AjaxChat: Chatting, the AJAX Way

Related Tutorials:

QTJ Audio
QTJ Audio QuickTime Java can be the heart and soul of cross-platform video players and editors QTJ is also well-suited to be the engine of audio-only applications, such as MP3 players. an audio player, QTBebop, that displays song metadata, band levels,
 
Smart Value Object goes one step further
Smart Value Object goes one step further The Smart Value Object allows server components to track client-side modification of business objects in a rich client/J2EE server environment, by using the latest features offered by bytecode processing tools.
 
Using CachedRowSet to Transfer JDBC Query Results Between Classes
Using CachedRowSet to Transfer JDBC Query Results Between Classes The Java Database Connectivity (JDBC) API provides developers with an interface to a SQL database server, such as MySQL or Oracle. Central to any JDBC application is the java.sql.ResultS
 
Using a JMS Provider with MDBs via the J2EE Connector Architecture
Using a JMS Provider with MDBs via the J2EE Connector Architecture In this article I will provide a brief introduction to MDB and the J2EE Connector Architecture (JCA), examining how MDBs can be deployed with the JCA 1.5 resource adapter to use a JMS pro
 
JMS Messaging Online Resource
JMS Messaging Online Resource JMS Tutorials JMS provides a way for Java programs to access an enterprise messaging system, also known as message oriented middleware (MOM). Check out the below tutorials.
 
InfoNode (Java Components)
InfoNode Docking Windows is a pure Java Swing based docking windows framework. The best way to see features of InfoNode Docking Windows is to try the Web Start demos.
 
An example of public use
ashkelon lite "ashkelon lite" provides all the benefits of the ashkelon product without any of the hassle and overhead. It's ashkelon in a war file. There's no need to setup a database, no need to configure _anything_, not even to populate a repository
 
Improve on Javadocs with ashkelon
Improve on Javadocs with ashkelon Sun's Javadocs provide us with automatically generated, hyperlinked documentation of fields, methods, classes, interfaces, and inner classes. They are helpful in many ways, but you will soon develop a wish list that incl
 
Testing J2EE applications
Testing J2EE applications There are certain aspects of J2EE applications that people associate with end-to-end tests rather than object tests. These include page flow—or navigating a Web application—and using container services, such as security and
 
Annotations in Tiger, Part 1: Add metadata to Java code
Annotations, a new feature in J2SE 5.0 (Tiger), brings a much-needed metadata facility to the core Java language. In this first of a two-part series, author Brett McLaughlin explains why metadata is so useful, introduces you to annotations in the Java lan
 
Trace Analyzer for WebSphere Application Server
Trace Analyzer for WebSphere Application Server is a graphical environment for analyzing WebSphere trace logs in detail. It was developed to facilitate the diagnosis and analysis of problems in complex WebSphere deployments.
 
Gain SQL SELECT functionality in Java
Gain SQL SELECT functionality in Java Summary In "Filter Collections," David Rappoport described a simple way to filter collections of objects. In this article, he expands on this idea and shows you how to treat an array or a collection of objects the s
 
Distributed Enterprise Messaging with MantaRay
A very important communication standard in Java is Java Messaging Service (JMS). JMS is a set of Java interfaces and associated semantics that define a way for a Java-based client to access a messaging system. JMS provides a rich, yet simple, set of messa
 
Servlets and JavaServer Pages (JSP) : A Tutorial
An excellent tutorial on JSP and Servlets.
 
Java Resources
There are all Java freebies. Some of these are old, and not under maintenance. Download and use them at your risk. In case of queries, mail subrahmanyam_avb@technologist.com or varalakshmi_a@techie.com.
 
Struts and Tiles aid component-based development
In the Java world, Struts is one of the best-known and most talked about open source embodiments of MVC.
 
Java Technology Fundamentals
Learn how to use variable arguments lists, the new JConsole utility to monitor applications, and discover ways to learn what you need to know to get Sun certified.
 
Welcome to Java Developers paradise!
Welcome to Java Developers paradise! T his site contains many quality Java, JSP, RMI, MySQL downloads, tutorials, source codes and links to other java resources. We have large number of links to the tutorials on java which will help you learn java
 
Web Site promotion services at roseindia.net
Web Site promotion services at roseindia.net Welcome to RoseIndia.net Web Submission Services Our Web site services will help you get listed in major search engines and directory of the world. Our own site traffic comes from the major search
 
ORA
ORA is a Framework written in Java (plattform independent).
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.