Java Reference
In-Depth Information
L ISTING 11.7 The Main JNLP file for the Optional Packages Installer Example
11
<?xml version=”1.0” encoding=”UTF-8”?>
<jnlp spec=”1.0+”
codebase=”http://server/b2/c11/”>
<information>
<title>Optional Pkg. Install.</title>
<vendor>Mauro's Workshop</vendor>
<offline/>
</information>
<resources>
<j2se version=”1.2+” />
<extension
name=”Installer”
href=”installer-ext.jnlp”>
</extension>
<jar href=”dummy-app.jar” />
</resources>
<application-desc main-class=”com.marinilli.b2.c11.DummyApp” />
</jnlp>
The JNLP extension descriptor file is listed below in Listing 11.8. Note that to access the file
system, we require signed installers specifying trusted permissions (that is, all-permissions
or j2see-application-client-permissions values) and that optional packages are located in
different directories within a JRE environment, depending on the platform. Consequently, the
platform-specific code has to be specified in the resources element, or the Java code should
be able to tell the difference. See the J2SE documentation on optional packages for more
details. For simplicity, we assumed a JRE exists that is compliant with the Windows environ-
ment.
L ISTING 11.8 The Extension Descriptor JNLP file for the Optional Packages Installer
Example
<?xml version=”1.0” encoding=”UTF-8”?>
<jnlp spec=”1.0+”
codebase=”http://server/b2/c11/”>
<information>
<title>Installer Example</title>
<vendor>Mauro's Workshop</vendor>
<offline/>
</information>
<security><all-permissions/></security>
<resources>
<j2se version=”1.2+” />
Search WWH ::




Custom Search