Hot questions for Using Applets in jnlp

Question:

I am trying to launch applet using JNLP. I want to pass some parameter dynamically to applet. My JNLP file looks like

<?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="http://localhost:8080/WebAppTest/jar/" href="">
        <information>
            <title>JNLP Test</title>
            <vendor>Java</vendor>
        </information> 
        <resources>
            <!-- Application Resources -->
            <j2se version="1.5+" />
            <jar href="test.jar" main="true" />            
        </resources>
        <security>
            <all-permissions/>
        </security>
        <applet-desc 
             name="Test Applet"
             main-class="com.test.TestApplet.class"
             width="100"
             height="30">
             <param name="testStr" value="something" />
        </applet-desc>
        <update check="background"/>
    </jnlp>

I want to set testStr value dynamically.


Answer:

You cant get Request object in jnlp file directly, So as an alternate make jnlp as a jsp page and pass the request and response to it as shown in here - and change the content type to application/x-java-jnlp-file as they did.

one more link http://portal.krypthonas.de/2010/10/11/passing-dynamically-parameters-to-a-java-web-start-app-jnlp/ with complete code snippets.

Question:

I have a Java Applet that works so far. Now I would like to start this applet via Web Start.

I have the files

  Multithreading.class
  test1.class
  test2.class
  manifest.txt
  index.html
  WebStart.jnlp

I build the jar file with jar cvfm WebStart.jar manifest.txt *.class

The html file contains:

<html lang="en-US">
<head>
    <title>Web start</title>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  </head>
  <body>
    <applet
    alt = "Web start"
    code = 'Multithreading'
    jnlp_href = 'WebStart.jnlp',
    width = 500,
    height = 500 />
  </body>
</html>

and the JNLP file:

<jnlp spec="1.0+" codebase="" href="">
    <information>
    <title>Web start</title>
    <vendor>Self</vendor>
    </information>
    <resources>
    <j2se version="1.8+"
         href="http://java.sun.com/products/autodl/j2se"/>
    <jar href="WebStart.jar" main="true" />
    </resources>
    <applet-desc 
     name="Web start"
     main-class="Multithreading"
     width="500"
     height="500">
     </applet-desc>
     <update check="background"/>
</jnlp>

The java versions I use are java -XshowSettings:properties -version:

 Property settings:
    awt.toolkit = sun.awt.X11.XToolkit
    file.encoding = UTF-8
    file.encoding.pkg = sun.io
    file.separator = /
    java.awt.graphicsenv = sun.awt.X11GraphicsEnvironment
    java.awt.printerjob = sun.print.PSPrinterJob
    java.class.path = .
    java.class.version = 52.0
    java.endorsed.dirs = /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/endorsed
    java.ext.dirs = /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext
    /usr/java/packages/lib/ext
    java.home = /usr/lib/jvm/java-8-openjdk-amd64/jre
    java.io.tmpdir = /tmp
    java.library.path = /usr/java/packages/lib/amd64
    /usr/lib/x86_64-linux-gnu/jni
    /lib/x86_64-linux-gnu
    /usr/lib/x86_64-linux-gnu
    /usr/lib/jni
    /lib
    /usr/lib
    java.runtime.name = OpenJDK Runtime Environment
    java.runtime.version = 1.8.0_45-internal-b14
    java.specification.name = Java Platform API Specification
    java.specification.vendor = Oracle Corporation
    java.specification.version = 1.8
    java.vendor = Oracle Corporation
    java.vendor.url = http://java.oracle.com/
    java.vendor.url.bug = http://bugreport.sun.com/bugreport/
    java.version = 1.8.0_45-internal
    java.vm.info = mixed mode
    java.vm.name = OpenJDK 64-Bit Server VM
    java.vm.specification.name = Java Virtual Machine Specification
    java.vm.specification.vendor = Oracle Corporation
    java.vm.specification.version = 1.8
    java.vm.vendor = Oracle Corporation
    java.vm.version = 25.45-b02
    line.separator = \n 
    os.arch = amd64
    os.name = Linux
    os.version = 3.19.0-26-generic
    path.separator = :
    sun.arch.data.model = 64
    sun.boot.class.path = /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/resources.jar
    /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/rt.jar
    /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/sunrsasign.jar
    /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jsse.jar
    /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jce.jar
    /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/charsets.jar
    /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jfr.jar
    /usr/lib/jvm/java-8-openjdk-amd64/jre/classes

So now when I put the html, jnlp and the jar file in my /var/www/html directory and call it with localhost/index.html I get the following error:

    Error: Unable to fetch applet instance id from Java side.
    Error on Java side:
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    java.lang.NullPointerException     at net.sourceforge.jnlp.NetxPanel.ourRunLoader(NetxPanel.java:117)     at sun.applet.AppletViewerPanelAccess.run(AppletViewerPanelAccess.java:86)     at java.lang.Thread.run(Thread.java:745) 
        at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:901) 
        at net.sourceforge.jnlp.Launcher.getApplet(Launcher.java:668) 
        at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:728) 
        at net.sourceforge.jnlp.runtime.JNLPClassLoader.loadClass(JNLPClassLoader.java:1471) 
        at net.sourceforge.jnlp.runtime.JNLPClassLoader.loadClassExt(JNLPClassLoader.java:1670) 
        at net.sourceforge.jnlp.runtime.JNLPClassLoader.findClass(JNLPClassLoader.java:1653) 
        at net.sourceforge.jnlp.runtime.JNLPClassLoader$CodeBaseClassLoader.findClassNonRecursive(JNLPClassLoader.java:2473) 
        at java.security.AccessController.doPrivileged(Native Method) 
        at net.sourceforge.jnlp.runtime.JNLPClassLoader$CodeBaseClassLoader$1.run(JNLPClassLoader.java:2474) 
        at net.sourceforge.jnlp.runtime.JNLPClassLoader$CodeBaseClassLoader$1.run(JNLPClassLoader.java:2476) 
        at net.sourceforge.jnlp.runtime.JNLPClassLoader$CodeBaseClassLoader.access$2001(JNLPClassLoader.java:2445) 
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354) 
        at java.security.AccessController.doPrivileged(Native Method) 
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355) 
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361) 
        at java.net.URLClassLoader.access$100(URLClassLoader.java:71) 
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) 
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) 
        at java.lang.ClassLoader.defineClass(ClassLoader.java:800) 
        at java.lang.ClassLoader.defineClass1(Native Method) 
    Caused by: java.lang.UnsupportedClassVersionError: Multithreading : Unsupported major.minor version 52.0 
        at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:927) 
    Exception in thread "Applet" java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Multithreading : Unsupported major.minor version 52.0 
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    java.lang.UnsupportedClassVersionError: Multithreading : Unsupported major.minor version 52.0     at java.lang.ClassLoader.defineClass1(Native Method)     at java.lang.ClassLoader.defineClass(ClassLoader.java:800)     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)     at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)     at java.net.URLClassLoader.access$100(URLClassLoader.java:71)     at java.net.URLClassLoader$1.run(URLClassLoader.java:361)     at java.net.URLClassLoader$1.run(URLClassLoader.java:355)     at java.security.AccessController.doPrivileged(Native Method)     at java.net.URLClassLoader.findClass(URLClassLoader.java:354)     at net.sourceforge.jnlp.runtime.JNLPClassLoader$CodeBaseClassLoader.access$2001(JNLPClassLoader.java:2445)     at net.sourceforge.jnlp.runtime.JNLPClassLoader$CodeBaseClassLoader$1.run(JNLPClassLoader.java:2476)     at net.sourceforge.jnlp.runtime.JNLPClassLoader$CodeBaseClassLoader$1.run(JNLPClassLoader.java:2474)     at java.security.AccessController.doPrivileged(Native Method)     at net.sourceforge.jnlp.runtime.JNLPClassLoader$CodeBaseClassLoader.findClassNonRecursive(JNLPClassLoader.java:2473)     at net.sourceforge.jnlp.runtime.JNLPClassLoader.findClass(JNLPClassLoader.java:1653)     at net.sourceforge.jnlp.runtime.JNLPClassLoader.loadClassExt(JNLPClassLoader.java:1670)     at net.sourceforge.jnlp.runtime.JNLPClassLoader.loadClass(JNLPClassLoader.java:1471)     at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:728)     at net.sourceforge.jnlp.Launcher.getApplet(Launcher.java:668)     at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:901) 
    Selected proxies: [DIRECT]
    Selecting proxy for: socket://localhost:80
    Selected proxies: [DIRECT]
    Selecting proxy for: http://localhost/Multithreading.class
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    System logger called with result of 0
    java.lang.UnsupportedClassVersionError: Multithreading : Unsupported major.minor version 52.0     at java.lang.ClassLoader.defineClass1(Native Method)     at java.lang.ClassLoader.defineClass(ClassLoader.java:800)     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)     at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)     at java.net.URLClassLoader.access$100(URLClassLoader.java:71)     at java.net.URLClassLoader$1.run(URLClassLoader.java:361)     at java.net.URLClassLoader$1.run(URLClassLoader.java:355)     at java.security.AccessController.doPrivileged(Native Method)     at java.net.URLClassLoader.findClass(URLClassLoader.java:354)     at net.sourceforge.jnlp.runtime.JNLPClassLoader.access$1701(JNLPClassLoader.java:103)     at net.sourceforge.jnlp.runtime.JNLPClassLoader$5.run(JNLPClassLoader.java:1636)     at net.sourceforge.jnlp.runtime.JNLPClassLoader$5.run(JNLPClassLoader.java:1634)     at java.security.AccessController.doPrivileged(Native Method)     at net.sourceforge.jnlp.runtime.JNLPClassLoader.findClass(JNLPClassLoader.java:1633)     at net.sourceforge.jnlp.runtime.JNLPClassLoader.loadClassExt(JNLPClassLoader.java:1670)     at net.sourceforge.jnlp.runtime.JNLPClassLoader.loadClass(JNLPClassLoader.java:1471)     at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:728)     at net.sourceforge.jnlp.Launcher.getApplet(Launcher.java:668)     at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:901) 
    Class-Path attribute cleared for /home/dan/.cache/icedtea-web/cache/21/http/localhost/WebStart.jar
    Stored action for unsigned applet at http://localhost/ was A - Always trust this (matching) applet(s)
    Codebase matches codebase manifest attribute, but application is unsigned. Continuing. See: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html for details.
    Trusted Only manifest attribute not found. Continuing.
    Permission added: ("java.io.FilePermission" "/home/dan/.cache/icedtea-web/cache/21/http/localhost/WebStart.jar" "read")
    Activate native: http://localhost/WebStart.jar
    Activate jar: file:/home/dan/.cache/icedtea-web/cache/21/http/localhost/WebStart.jar
    Jars not ready to provide main class
    Jars not ready to provide attribute Application-Name
    Jar found at /home/dan/.cache/icedtea-web/cache/21/http/localhost/WebStart.jarhas been verified as UNSIGNED
    App already has trusted publisher: false
    Jar found at /home/dan/.cache/icedtea-web/cache/21/http/localhost/WebStart.jarhas been verified as UNSIGNED
    @ /WebStart.jar
    -(DOWNLOAD)
    +(DOWNLOADED)
    Status: CONNECTED DOWNLOADED STARTED
    @ /WebStart.jar
    -(CONNECTING)
    +(CONNECTED)
    Status: CONNECTED DOWNLOAD STARTED
    isCurrent: http://localhost/WebStart.jar = true
    Selected proxies: [DIRECT]
    Selecting proxy for: http://localhost/WebStart.jar
    best url for location=http://localhost/WebStart.jar state=CONNECTING DOWNLOAD STARTED is http://localhost/WebStart.jar by HEAD
    Key : Server ,Value : [Apache/2.4.10 (Ubuntu)]
    Key : Accept-Ranges ,Value : [bytes]
    Key : Connection ,Value : [Keep-Alive]
    Key : Content-Type ,Value : [application/java-archive]
    Key : Keep-Alive ,Value : [timeout=5, max=99]
    Key : Last-Modified ,Value : [Wed, 02 Sep 2015 12:18:18 GMT]
    Key : Content-Length ,Value : [4239]
    Key : Date ,Value : [Wed, 02 Sep 2015 13:13:31 GMT]
    Key : ETag ,Value : ["108f-51ec2a96a42f7"]
    Key : null ,Value : [HTTP/1.1 200 OK]
    Selected proxies: [DIRECT]
    Selecting proxy for: http://localhost/WebStart.jar
    All possible urls for location=http://localhost/WebStart.jar state=CONNECTING DOWNLOAD STARTED : [http://localhost/WebStart.jar, http://localhost/WebStart.jar]
    @ /WebStart.jar
    -(CONNECT)
    +(CONNECTING)
    Status: CONNECTING DOWNLOAD STARTED
    @ /WebStart.jar
    +(DOWNLOAD)
    Status: CONNECT DOWNLOAD STARTED
    @ /WebStart.jar
    +(CONNECT)
    Status: CONNECT STARTED
    @ /WebStart.jar
    +(STARTED)
    Jars not ready to provide main class
    Status: STARTED
    Jars not ready to provide attribute Application-Name
    New classloader: http://localhost/WebStart.jnlp
            result: null
    Jars not ready to provide main class
    Jars not ready to provide attribute Application-Name
    Acquired shared lock on /tmp/dan/netx/locks/netx_running to indicate javaws is running
    Jars not ready to provide main class
    Jars not ready to provide attribute Application-Name
    UNIQUEKEY=1441199611454-1695405956-http://localhost/WebStart.jnlp
    Acceptable vendor tag found, contains: Self
    Acceptable title tag found, contains: Web start
    Jars not ready to provide attribute Application-Name
    Description: null
    Homepage: null
    line: 24

    line: 23
    line: 22
    line: 21
    line: 20
    line: 19
    line: 18 </jnlp>
    line: 17      <update check="background"/>
    line: 16      </applet-desc>
    line: 15      height="500">
    line: 14      width="500"
    line: 13      main-class="Multithreading"
    line: 12      name="Web start"
    line: 11    <applet-desc
    line: 10    </resources>
    line: 9     <jar href="WebStart.jar" main="true" />
    line: 8         href="http://java.sun.com/products/autodl/j2se"/>
    line: 7     <j2se version="1.8+"
    line: 6    <resources>
    line: 5    </information>
    line: 4      <vendor>Self</vendor>
    line: 3     <title>Web start</title>
    line: 2    <information>
    <jnlp spec="1.0+" codebase="" href="">
    @ /WebStart.jnlp
    -(DOWNLOADING)
    +(DOWNLOADED)
    Status: CONNECTED DOWNLOADED STARTED
    Downloadinghttp://localhost/WebStart.jnlp using http://localhost/WebStart.jnlp (encoding : null)
    Selected proxies: [DIRECT]
    Selecting proxy for: socket://localhost:80
    Selected proxies: [DIRECT]
    Selecting proxy for: http://localhost/WebStart.jnlp
    @ /WebStart.jnlp
    -(DOWNLOAD)
    +(DOWNLOADING)
    Status: CONNECTED DOWNLOADING STARTED
    @ /WebStart.jnlp
    -(CONNECTING)
    +(CONNECTED)
    Status: CONNECTED DOWNLOAD STARTED
    isCurrent: http://localhost/WebStart.jnlp = false
    Selected proxies: [DIRECT]
    Selecting proxy for: http://localhost/WebStart.jnlp
    best url for location=http://localhost/WebStart.jnlp state=CONNECTING DOWNLOAD STARTED is http://localhost/WebStart.jnlp by HEAD
    Key : Server ,Value : [Apache/2.4.10 (Ubuntu)]
    Key : Accept-Ranges ,Value : [bytes]
    Key : Connection ,Value : [Keep-Alive]
    Key : Content-Type ,Value : [application/x-java-jnlp-file]
    Key : Keep-Alive ,Value : [timeout=5, max=100]
    Key : Last-Modified ,Value : [Wed, 02 Sep 2015 13:07:41 GMT]
    Key : Content-Length ,Value : [442]
    Key : Date ,Value : [Wed, 02 Sep 2015 13:13:30 GMT]
    Key : ETag ,Value : ["1ba-51ec35a097c7f"]
    Key : null ,Value : [HTTP/1.1 200 OK]
    Selected proxies: [DIRECT]
    Selecting proxy for: socket://localhost:80
    Selected proxies: [DIRECT]
    Selecting proxy for: http://localhost/WebStart.jnlp
    All possible urls for location=http://localhost/WebStart.jnlp state=CONNECTING DOWNLOAD STARTED : [http://localhost/WebStart.jnlp, http://localhost/WebStart.jnlp]
    Detected online set to: true
    @ /WebStart.jnlp
    -(CONNECT)
    +(CONNECTING)
    Status: CONNECTING DOWNLOAD STARTED
    @ /WebStart.jnlp
    +(DOWNLOAD)
    Status: CONNECT DOWNLOAD STARTED
    @ /WebStart.jnlp
    +(CONNECT STARTED)
    Status: CONNECT STARTED
    java.lang.ClassNotFoundException: java/net/URLPermission     at java.lang.Class.forName0(Native Method)     at java.lang.Class.forName(Class.java:191)     at net.sourceforge.jnlp.SecurityDesc.<clinit>(SecurityDesc.java:164)     at net.sourceforge.jnlp.JNLPFile.<init>(JNLPFile.java:137)     at net.sourceforge.jnlp.PluginBridge.<init>(PluginBridge.java:90)     at net.sourceforge.jnlp.PluginBridge.<init>(PluginBridge.java:67)     at net.sourceforge.jnlp.NetxPanel.ourRunLoader(NetxPanel.java:101)     at sun.applet.AppletViewerPanelAccess.run(AppletViewerPanelAccess.java:86)     at java.lang.Thread.run(Thread.java:745) 
    Exception while reflectively finding URLPermission - host is probably not running Java 8+
    JNLPRuntime already initialized
    Using NetX panel
    Read 181 entries from Firefox's preferences
    Found preferences file: /home/dan/.mozilla/firefox/vq92ezur.default/prefs.js
    Using firefox's profiles file: /home/dan/.mozilla/firefox/profiles.ini
    Starting security dialog thread
    Started processing of plugin-debug-to-console /run/user/1000/icedteaplugin-dan-XkKfMv/12261-icedteanp-plugin-debug-to-appletviewer
    Starting processing of plugin-debug-to-console /run/user/1000/icedteaplugin-dan-XkKfMv/12261-icedteanp-plugin-debug-to-appletviewer
    WARNING: key deployment.system.cachedir has no value, setting to default value
    No User level deployment.properties found.
    java.io.FileNotFoundException: /home/dan/.config/icedtea-web/deployment.properties (No such file or directory)     at java.io.FileInputStream.open(Native Method)     at java.io.FileInputStream.<init>(FileInputStream.java:146)     at java.io.FileReader.<init>(FileReader.java:72)     at net.sourceforge.jnlp.config.DeploymentConfiguration.parsePropertiesFile(DeploymentConfiguration.java:655)     at net.sourceforge.jnlp.config.DeploymentConfiguration.findSystemConfigFile(DeploymentConfiguration.java:479)     at net.sourceforge.jnlp.config.DeploymentConfiguration.load(DeploymentConfiguration.java:292)     at net.sourceforge.jnlp.config.DeploymentConfiguration.load(DeploymentConfiguration.java:262)     at net.sourceforge.jnlp.runtime.JNLPRuntime$DeploymentConfigurationHolder.initConfiguration(JNLPRuntime.java:451)     at net.sourceforge.jnlp.runtime.JNLPRuntime$DeploymentConfigurationHolder.<clinit>(JNLPRuntime.java:446)     at net.sourceforge.jnlp.runtime.JNLPRuntime.getConfiguration(JNLPRuntime.java:481)     at net.sourceforge.jnlp.config.DirectoryValidator.<init>(DirectoryValidator.java:224)     at net.sourceforge.jnlp.config.DeploymentConfiguration.move14AndOlderFilesTo15Structure(DeploymentConfiguration.java:829)     at net.sourceforge.jnlp.config.DeploymentConfiguration.move14AndOlderFilesTo15StructureCatched(DeploymentConfiguration.java:733)     at sun.applet.PluginMain.main(PluginMain.java:139) 
    cache: /home/dan/.cache/icedtea-web file exists:true
    config: /home/dan/.config/icedtea-web file exists: true
    System is already following XDG .cache and .config specifications
    2: /run/user/1000/icedteaplugin-dan-XkKfMv/12261-icedteanp-plugin-debug-to-appletviewer
    1: /run/user/1000/icedteaplugin-dan-XkKfMv/12261-icedteanp-appletviewer-to-plugin
    0: /run/user/1000/icedteaplugin-dan-XkKfMv/12261-icedteanp-plugin-to-appletviewer
    startup arguments:

Answer:

Your exception says

Multithreading : Unsupported major.minor version 52.0 

52 is the major class version in Java 8, and since you've complied the class Multithreading with Java 8, that version number makes sense.

You can verify this using:

javap -verbose Multithreading | grep "major"

UnsupportedClassVersionError usually happens when you are trying to load a class with lower Java version but the class is complied with a higher Java version.

In your case that shouldn't normally happen since you are using the same environment. But due to some reason (possibly something to do with the net.sourceforge.jnlp.runtime.JNLPClassLoader) your JRE doesn't seem to like the 52 version.


You could try the following:

  1. Compile your class using lower target version:

    javac -target 1.6 Multithreading.java

  2. If that doesn't work, try switching to Oracle JDK instead of OpenJDK, compile again and see if it works.

Question:

I need to put arguments in a Applet but i must use the deployJava library js.

My code is:

var attributes = {id : "GenericDiv", code: namespace, width:200, height:200}; 
var parameters = {args: "{'eventHandler':'fingerprint'}", jnlp_href:'/xxx.jnlp' }; 
var version = '1.6' ; 
deployJava.runApplet(attributes, parameters, version); 

But the code doesn't work, the javascript haven't attachs the fingerprint.

Thanks all ;)


Answer:

Specifying an Applet's Input Parameters

You can specify an applet's input parameters in the applet's Java Network Launch Protocol (JNLP) file or in the element of the <applet> tag. It is usually better to specify the parameters in the applet's JNLP file so that the parameters can be supplied consistently even if the applet is deployed on multiple web pages. If the applet's parameters will vary by web page, then you should specify the parameters in the <parameter> element of the <applet> tag.

The example on that page shows two different ways to define the applet parameters:

Consider an applet that takes three parameters. The paramStr and paramInt parameters are specified in the applet's JNLP file, applettakesparams.jnlp.

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="" href="">
    <!-- ... -->
    <applet-desc
         name="Applet Takes Params"
         main-class="AppletTakesParams"
         width="800"
         height="50">
             <param name="paramStr"
                 value="someString"/>
             <param name="paramInt" value="22"/>
     </applet-desc>
     <!-- ... -->
</jnlp>

The paramOutsideJNLPFile parameter is specified in the parameters variable passed to the Deployment Toolkit script's runApplet function in AppletPage.html.

<html>
  <head>
    <title>Applet Takes Params</title>
    <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
  </head>
  <body>
    <h1>Applet Takes Params</h1>

    <script
      src="https://www.java.com/js/deployJava.js"></script>
    <script>
        var attributes = { code:'AppletTakesParams.class',
            archive:'applet_AppletWithParameters.jar',
            width:800, height:50 };
        var parameters = {jnlp_href: 'applettakesparams.jnlp',
            paramOutsideJNLPFile: 'fooOutsideJNLP' };
        deployJava.runApplet(attributes, parameters, '1.7');
    </script>

  </body>
</html>

Source Defining and Using Applet Parameters.