Java Reference
In-Depth Information
For this little experiment, we need the following pieces:
•A JNLP file—an XML file that will contain all the details.
• One JAR file, containing a simple Java class. This will represent our application.
All of the following files are available on the companion Web site for this topic.
They are organized under the test directory. Copy it onto your local hard disk
under the c:/ path.
Listing 8.1 is on the Companion Web site for this topic.
L ISTING 8.1 The Test JNLP File
<?xml version=”1.0” encoding=”UTF-8”?>
<jnlp spec=”1.0+”
codebase=”file:///c:/test/”
href=”test.jnlp”>
<information>
<title>Hello JNLP</title>
<homepage href=”” />
<vendor>Mauro's Workshop</vendor>
<offline/>
</information>
<resources>
<j2se version=”1.2+” />
<jar href=”bin/test.jar” />
</resources>
<application-desc />
</jnlp>
This XML file instructs the JNLP Client on several things.
• Where the resources are located (on the local file system, see the protocol “ file:/// ”in
line 3).
• Where to find the JNLP file itself, so that the application it represents can be cached in
the application manager, and so on.
• Some information about the application: its title, vendor, and the Web page in which you
can look for updates.
• The resources needed by the application. In this case, a single JAR file will suffice. Note
the <j2se> element, which informs the JNLP Client about the version of J2SE needed to
run that application. The string “ 1.2+ ” means J2SE version 1.2 or any higher.
Search WWH ::




Custom Search