PowerPoint lunch and learn on WebStart and JNLP

Download Report

Transcript PowerPoint lunch and learn on WebStart and JNLP

Java WebStart
Created by Bob Hays
Proprietary & Confidential
What is Java™ WebStart?
 Deployment technology for Java


Applications
Libraries/Components
 Implements JNLP – Java Network Launching Protocol, which was created
via the Java Community Process (JSR-56)
 Java™ WebStart supports:







Multiple JREs
Code-signing
Sandboxing
Versioning and incremental updates
Desktop integration
Offline operation
Automatic installation of JREs and optional packages Application launcher
 Java™ WebStart is currently at version 1.0.1_01 and can be found at
http://java.sun.com/products/javawebstart/index.html
Proprietary & Confidential
Why use Java WebStart and JNLP?
 Java provides a rich graphical interface environment, but
applets have problems
 JNLP allows controlled and secure installation of remotely
provided applications
 Installation can be simplified and standardized
 Installed files are cached locally and checked for update when
the application is invoked
 “The speed and responsiveness of the application does not
depend on the connection speed”1
 “Applications work offline, for example, in a plane when traveling”1
 Maintenance of multiple applications can be handled remotely
 Web browser independent
1”Java™
WebStart Architecture”, http://java.sun.com/products/javawebstart/architecture.html
Proprietary & Confidential
JNLP depends upon standards
 XML language to describe the installation
 HTTP for transmission of executables
 WAR file packaging
 And Java, of course!
Proprietary & Confidential
What are the steps to use Java WebStart?
 Set up your web server for delivering WebStart content

Configure the Web server so that all files with the .jnlp file extension are set to the
application/x-java-jnlp-file MIME type
 Pick an application and identify all the jar files required – everything delivered must
be in one or more jar files
 If the application will run in the sandbox:


Use the getResource() method to obtaining information always from within jar files
If an application is written to run in a secure sandbox, it must follow these restrictions:







No access to local disk.
All JAR files must be downloaded from the same host.
Network connections are enabled only to the host from which the JAR files are downloaded.
No security manager can be installed.
No native libraries.
Limited access to system properties. The application has read/write access to all system properties
defined in the JNLP File, as well as read-only access to the same set of properties than an Applet has
access to.
An application is allowed to use the System.exit call.
 Or if the application will have full access to the customer’s system:


Sign all jar files with a common signature
You can request full access to the system, and the customer will be prompted to accept this at
installation time.
Proprietary & Confidential
What are the steps to use Java WebStart? redux
 Create a JNLP XML file to describe the installation
 Create a web page to deliver the application via WebStart

<a href="MyApp.jnlp">Launch My Application</a>
 JavaScript and VBScript is provided for identifying if WebStart is installed
and going to an installation point at this URL:

http://java.sun.com/products/javawebstart/docs/developersguide.html#dev
Proprietary & Confidential
An example JNLP file, part 1
<?xml version="1.0" encoding="UTF-8"?>
<!-><!--
created on Tue Jul 10 06:30:10 CDT 2001
1.3.0_01
-->
--><!--
created by Bob Hays Computer Ge on Windows 2000
<jnlp spec="1.0+" version="1.0" href="file:///Classes/WebStartBunde/TrackMyTime.jnlp">
<information locale="en">
<title>TrackMyTime</title>
<vendor>Aleph Naught and the Null Set</vendor>
<homepage href="http://alephnaught.net/~electricbob" />
<description kind="">Graphical tool to track time spent on work.</description>
<offline-allowed />
<icon kind="" href="file:///Classes/com/rhays/fffields/32x32icon.gif" version="1.0" width="32" height="32" depth="16"
size="224" />
<icon kind="selected" href="file:///Classes/com/rhays/fffields/32x32icon.gif" version="1.0" width="32" height="32"
depth="16" size="224" />
<icon kind="disabled" href="file:///Classes/com/rhays/fffields/32x32icon.gif" version="1.0" width="32" height="32"
depth="16" size="224" />
<icon kind="rollover" href="file:///Classes/com/rhays/fffields/32x32icon.gif" version="1.0" width="32" height="32"
depth="16" size="224" />
</information>
Proprietary & Confidential
--
An example JNLP file, part 2
<resources>
<jar href="file:///Classes/Jars/rhays.jar" main="false" download="eager" size="2279711" />
<jar href="file:///Classes/WebStartBunde/activation.jar" main="false" download="eager" size="45386" />
<jar href="file:///Classes/WebStartBunde/adc.jar" main="false" download="eager" size="15334" />
<jar href="file:///Classes/WebStartBunde/antlr.jar" main="false" download="eager" size="89325" />
<jar href="file:///Classes/WebStartBunde/jaccess.jar" main="false" download="eager" size="44853" />
<jar href="file:///Classes/WebStartBunde/jgl3.1.0.jar" main="false" download="eager" size="963513" />
<jar href="file:///Classes/WebStartBunde/xerces.jar" main="false" download="eager" size="1489678" />
<jar href="file:///Classes/WebStartBunde/xercesSamples.jar" main="false" download="eager" size="179270" />
<jar href="file:///Classes/WebStartBunde/jas.jar" main="false" download="eager" size="12463" />
<j2se version="1.3" />
<jar href="file:///Classes/WebStartBunde/jhall.jar" main="false" download="eager" />
</resources>
<application-desc main-class="com.rhays.trackMyTime.TrackMyTime" />
<security>
<all-permissions />
</security>
</jnlp>
Proprietary & Confidential
What happens when you use WebStart?
1
2
3
Proprietary & Confidential
WebStart includes a launcher too
Proprietary & Confidential
An example - TrackMyTime
You can go to:
http://lobo.lasalle.na.abnamro.com/~bhays/WebStart/
to see WebStart in action and to download any of four applications:




TrackMyTime – a simple time tracking application
TrackMyTime Reports – reports for the time tracking tool
TrackMyTime Time Editor – edit old and future time records
FlatFileFields – a tool to graphically create an XML file to describe a flat file
Proprietary & Confidential
Third parties are supporting JNLP and WebStart
 OpenJNLP - http://openjnlp.nanode.org/
 Deployment tools:


VampHQ - http://www.geocities.com/vamp201/
Sitraka DeployDirector Bundler http://www.sitraka.com/software/deploydirector/bundler.html
Proprietary & Confidential
So, what are some of issues Bob has found?
 You have to sign ALL jar files with the same signature if you want to play
outside the sandbox

You have to resign all the Sun extension jars, for example, with your signature
 Using tools to build the jar files, handle signatures, and create the XML
driver files is very useful

I used DeployDirector Bundler and it worked well
 When you move a WebStart application on the server, you need to change
the JNLP file to contain the new self-pointer.
Proprietary & Confidential
Any Questions?
Bob Hays
Neogration, Inc.
[email protected]
(312) 904-4668
Please visit our web site at
http://www.neogration.com
Proprietary & Confidential