Contents / Previous / Next


Applet WebStart/JNLP

In order to enable your users to launch the application from a Web page, you must include a link to the application's JNLP file from that Web page. To add this link, you use the standard HTML link syntax, with the href attribute specifying the location of the JNLP file:
    <a href="JOGLbase.jnlp">JOGLbase Application/Applet</a>
Assuming Java Web Start is installed on the client computer, when the user clicks this link, Java Web Start executes the application (or applet) based on the instructions in the JNLP file.

The JNLP 1.0 specification requires all JAR files used in a JNLP file to be signed by the same certificate. This restriction avoids requiring the user to accept multiple certificates from the same source, and enables Java Web Start to know if the user has accepted all certificates used for an application.

However, Java Web Start can use multiple JAR files signed by different certificates, by using the component extension mechanism and multiple JNLP files.

JOGLbase.jnlp file:

<?xml version="1.0" encoding="utf-8"?>
<jnlp
spec="1.0+"
codebase="http://www.felixgers.de/teaching/jogl/lib"
href="JOGLbase.jnlp">

<information>
  <title>JOGL Base</title>
  <vendor>Felix Gers</vendor>
  <homepage href="http://www.felixgers.de"/>
  <description>JOGL Base Client</description>
  <description kind="short">JOGL Base Class</description>
  <icon href="../pics/cube.gif"/>
  <icon kind="../pics/splash" href="cube.gif"/>
  <offline-allowed/> 
</information>

<security>
<all-permissions/>
</security>

<resources>
 <j2se version="1.4+" java-vm-args="-esa -Xnoclassgc"/>
 <jar href="signed_JOGLbase.jar" main="true"/>
</resources>

<extension name="jogl"
href="http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jnlp" />

  <applet-desc	
      documentBase="http://www.felixgers.de/teaching/jogl/lib"
      name="JOGLbase"
      main-class="JOGLbase"
      width="600"
      height="400">
    <param name="key1" value="value1"/>
    <param name="key2" value="value2"/>
  </applet-desc>       
</jnlp>
For an application replace the applet-desc section with:
<application-desc main-class="JOGLbase"/>
You can test your application use javaws offline.
 javaws JOGLbase.jnlp


Applet WebStart/JNLP Links

http://www.cokeandcode.com/book/print/11
http://www.cokeandcode.com/info/webstart-howto.html
http://java.sun.com/docs/books/tutorial/deployment/webstart/deploying.html
http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/contents.html
http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/faq.html#208
http://www.lug-kr.de/wiki/JavaWebStart
http://communitygrids.blogspot.com/2006/05/java-web-start-shortens-my-time-on.html
JNLP File Syntax
mobilefish javawebstart Bouncing example
genedavissoftware Bouncing example