Getting started
Surfing the Internet is now an experience that is second nature to most people who have access to a computer. However, the ease with which information can be accessed hides the basic client-server architecture of the Web -- an architecture in which servers are busy processing information and clients remain more or less idle. Often situations occur in which it would be much more convenient to free the server of a portion of its load by having the client participate in the execution of a fraction of the work.
This tutorial will examine this type of situation, detailing the use of the Java Network Launch Protocol (JNLP) API to shift some of the load to the client. JNLP is usually defined as a mechanism for transferring a server-resident application over a network and across firewalls, and launching it on a client. JNLP is a component protocol of Java Web Start -- a technology for simplifying deployment of Java applications by allowing users to launch full-featured applications with a single click from a Web browser without going through complicated installation procedures. Java Web Start is bundled with J2SE.
You should take this tutorial if you want to develop a Java application, package it and make it secure, transfer it from server to client side, then enable it to launch easily and quickly on the client side without a messy installation process. You'll learn how to use the Java Web Start technology, focusing on the JNLP API.
The Fruit Salad Elementary School case study
This tutorial introduces the Fruit Salad Elementary School Web site. The Web site provides a single Web page where the pupils can practice their addition tables. The pupils learn an addition rule by selecting a pair of fruits of different kinds (an apple and an orange, two oranges and a banana, and so). By clicking on a pair of fruits, JNLP is invoked dynamically and transfers data along with an application to the pupil's workstation. At the end of the exercise, the result of the addition is sent back to the server so Mrs. Fruit Jam, the Math teacher, can monitor the children's individual performances and usage.
While this case study is fairly simplistic, it mimics the more complex problem encountered in the engineering project described in A real-world example.
To run the application demonstrated in this tutorial, you need a servlet container installed. If you don't have access to a rugged enterprise-strength container such as WebSphere Application Server, then the open source Tomcat server from the Apache Group is a good choice.
On the client, you need a JNLP-compliant activator installed. If you are not experienced in this area, I suggest using Java Web Start, which comes bundled with the J2SE platform, version 1.4.x. Alternatives to Java Web Start are OpenJNLP or Netx, two open source implementations of JNLP. In this tutorial, I've used Java Web Start as the JNLP activator.
You should have at least a basic understanding of Ant, the ubiquitous build tool from the Apache Software Foundation, along with a working knowledge of Java servlets, JSP technology, and general Java programming.
For links to all the items discussed above, including the source code for the FruitProcessor application, see Resources.

