Java Reference
In-Depth Information
As an aside, the JNLP file that launches the native installer without removing the temporary
file is shown in Listing 9.7. The only difference is in line 15, where the leaveTempFile string
is passed as a parameter to the main() method.
L ISTING 9.7
The install-win2 JNLP File
<?xml version=”1.0” encoding=”utf-8”?>
<jnlp spec=”1.0+”
codebase=”http://server/b2/c9/install-win/”>
<information>
<title>An Installer Launched via JNLP</title>
<vendor>Mauro Inc.</vendor>
<description>An Installer Launched via JNLP..</description>
</information>
<security><all-permissions/></security>
<resources>
<j2se version=”1.3+”/>
<jar href=”install-win.jar” os=”Windows”/>
</resources>
<application-desc main-class=”com.marinilli.b2.c9.InstallWin”>
<argument>leaveTempFile</argument>
<application-desc/>
</jnlp>
N OTE
Listing 9.7 is also a very simple example of how different behavior can be accom-
plished without modifying the code (the JAR files) by using different JNLP launch
files.
Describing Applets
Applets are defined by mimicking the syntax of the HTML <applet> tag. Listing 9.8 shows an
example of a JNLP file snippet describing an applet.
L ISTING 9.8
An Example of the Applet-Desc Element
<applet-desc
main-class=”com.myCompany.MyAppletClass”
documentbase=”index.htm”
name=”MyAppletClass”
width=”300”
height=”300”>
Search WWH ::




Custom Search