Last Updated: May 11th, 2009
Join
the asynchronous Web revolution! Emerging Ajax techniques -- variously
called Ajax Push, Comet, and HTTP streaming -- are bringing
revolutionary changes to Web application interactivity, moving the Web
into the Participation Age. Because Ajax-based applications are almost
becoming the de facto technology for designing Web-based applications,
it is more and more important that such applications react on the fly,
to both client and server events. Ajax can be used to enable the
browser to request information from the Web server but does not allow a
server to push updates to a browser. Comet solves this problem. It is a
technology that enables Web servers to asynchronously push events to
Web clients, enabling event driven operations and functions, previously
unheard of with traditional Web applications, to approach the
capabilities of desktop applications.
In
this lab, you will use NetBeans IDE to rapidly develop rich web
application and then you will use Glassfish Application server to
deploy the application. This lab provides an brief introduction to the
asynchronous web, AJAX polling, long polling, and Streaming, explaining
the Bayeux protocol, Cometd, Grizzly Comet implementation on
GlassFish. Different approaches and best practices to develop
comet application will also be discussed. You will learn how to develop
the chat application, how to implement distance learning slideshow
application, how to access Restful web services and database, how to
manage a chat application from the server and how to develop a
two-player distributed game application. Attendees will take away
the tactics they need in order to add multiuser collaboration,
notification and other Comet features to their application, whether
they develop with Dojo, jQuery, jMaki, or Prototype and whether they
deploy on Jetty, Tomcat, or the GlassFish Application Server.
Copyright
Copyright 2009 Sun Microsystems, Inc. All rights reserved. Sun, Sun Microsystems,
the Sun logo, Solaris, Java, the Java Coffee Cup logo, JavaOne, the JavaOne logo,
and all Solaris-based and Java-based marks and logos are trademarks or registered
trademarks of Sun Microsystems, Inc. in the United States and other countries.
Prerequisites
This hands-on lab assumes you have some basic knowledge of, or
programming experience in, the following technologies:
- Java™ language programming
- Exposure to AJAX, Java Script programming preferred
System Requirements
- Supported OSes: Solaris™M 8/9/10 Operating System (OS),
OpenSolaris™ Operating System (OS), Linux, Windows, Mac OS X 10.4+
- Memory requirement: 512MB
- Disk space requirement: 650-750 MB depends on the OS. See the requirement for more detail.
Software Needed For This Lab
Please install the following set of software. If you have any
questions on installation, please feel free to send questions to the
lab forum mentioned below.
Notations Used in This Documentation
- <lab_root> - directory into which lab zip
file is unzipped
- This document uses <lab_root> to
denote the directory under which you have unzipped the lab zip file of
this hands-on lab. The name of the lab zip file of this hands-on lab is 5558_cometajax.zip.
- Once you unzipped the lab zip file under <lab_root>,
it will create a subdirectory called cometajax.
For example, under Solaris, if you have unzipped the lab zip file in
the /home/dant directory, it
will create /home/dant /cometajax directory.
- This lab will use multiple Firefox profiles. Instructions to set this up are in Exercise 0.
FOR JAVAONE 2009 MACHINE PROVIDED LABS: We have setup the profiles for you already. To launch Firefox, open a terminal window and type the command: ff
Then select User 1 or User 2 depending on if this is the first or second browser you are opening.
- The lab machines are running Java Desktop System over
Solaris 10
- In order to open a terminal window in Java Desktop System,
right click any point in the background of the desktop, and select Open
Terminal in the pop-up menu.
- The following source code editors are provided on the lab
machines
- vi (type vi in a terminal window)
- emacs (type emacs in a terminal window)
- jedit (type jedit in a terminal window)
- NetBeans IDE (either click NetBeans IDE icon or type
netbeans in a terminal window)
Lab Exercises
Additional Resources
Where To Go For Help
- For general questions and feedback on JavaOne Hands-On Labs, please use the JavaONE_HOL_Forum.
- You can send your questions about grizzly and comet to the
grizzly public users alias:
Back to top
To
exercises