Skip to main content


developerWorks  >  Web development | XML  >

Create an Ajax-based IM client

Turn IM traffic into Web traffic using Jabber and a Web page

developerWorks

Level: Intermediate

Nicholas Chase (ibmquestions@nicholaschase.com), Freelance Writer

29 Apr 2008

Register now or sign in using your IBM ID and password.

The ability to instant message (IM) co-workers and friends is a great convenience, but some environments prohibit the use of instant messaging clients in the workplace due to security concerns. The exercise in this tutorial resolves any security concerns by showing you how to use Ajax to create a Web-based IM client that turns IM traffic into plain Web traffic by creating an instant messaging "bot" and a corresponding Web application. While it's not a production application, it demonstrates several nifty Ajax techniques, such as how to use Prototype to do easier DOM manipulation and how to easily update sections of a Web page, either once or repeatedly.

Objectives

In this tutorial, you create a Web-based instant messaging client using the Prototype Javascript library and a Jabber server. When it's complete, you will be able to choose among users who are on your buddy list and send and receive messages through the Web page to users on traditional IM clients.

Prerequisites

You should be familiar with Ajax development.


System requirements

  • Openfire: An instant messaging service to communicate with. Openfire is an open source Jabber server that runs on the Windows® operating system, MacOs, or Linux®.
  • Spark: An instant messaging client so you can see what's going on. Spark is an open source Jabber client from the people who bring you Openfire.
  • Smack: A way to communicate with the Jabber server. The Smack Java API provides all of the functionality you'll need.
  • Prototype: The Prototype JavaScript library that creates and manages the Ajax application.
  • Apache Tomcat: A Java Web application server capable of running servlets in order to run this application.
  • Eclipse or another Java environment: You build Java applications in this tutorial, so you'll be well served by using a Java IDE such as Eclipse, which lets you develop right on an application server for convenience. Alternatively, download the Java SDK from http://java.sun.com.


Duration

1 hour


Formats

html, pdf


Share this....

digg Digg this story del.icio.us del.icio.us Slashdot Slashdot it!


Back to top


Document options

Document options requiring JavaScript are not displayed

Discuss