Java Reference
In-Depth Information
• The part the JAR file belongs to. Parts are id strings (whose definition scope is local to
the current JNLP file only) that group together resources for download. Whenever a code
resource with a specified part attribute is downloaded, all the resources with the same
part are downloaded as well.
• Whether it is the main JAR file or not. If the main attribute is present with “true” as a
value, as in the following, the JAR file is the one that contains the class to be launched
through its main(..) method in order to execute the application:
<jar href=”” main=”true”/>
Otherwise, if “false” or no main attribute is specified at all, the JAR file isn't the main
one.
The only exception to this is when no JAR file is specified as the main one. In this case,
the JNLP Client assumes the first one mentioned in the JNLP file as main.
T IP
To avoid confusion and unintended behavior when modifying a JNLP file, it is always
a good idea to specify a JAR file as the main one, without relying on the line order-
ing in the JNLP file.
Lazy resources are loaded when the JVM needs them by means of the custom classloader
installed by the JNLP Client.
To recap, Listing 10.2 shows a JNLP file example.
L ISTING 10.2 Example of Use of the Information Element
<jnlp>
<?xml version=”1.0” encoding=”UTF-8”?>
<jnlp spec=”1.0+”
codebase=”http://server/b2/c10/”
href=”jnlpexample.jnlp”>
<information>
<title>A JNLP Example File</title>
<vendor>Mauro's Workshop</vendor>
<description>Welcome !</description>
<description kind=”tooltip”>a brief description</description>
<homepage href=”default.html” />
</information>
<information locale=”it”>
10
Search WWH ::




Custom Search