Cannot get applet parameters with JWS in windows10

526 Views Asked by At

I have a Java applet. I am trying to open it with Java Web Start. I have created the following JNLP file:

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://www.test.com/test"
 href="http://www.test.com/test/TestJWS.jnlp">
    <information>
        <title>Test</title>
        <vendor>Test</vendor>
    </information>
    <resources>
        <!-- Application Resources -->
        <j2se version="1.7+"
              href="http://java.sun.com/products/autodl/j2se"/>
        <jar href="test.jar"
            main="true" />
    </resources>
    <security>
        <all-permissions/>
    </security>
    <applet-desc
         name="test"
         main-class="main.testApplet"
         width="300"
         height="300">
        <param name="TestParam" value="12345"/>
     </applet-desc>
     <update check="background"/>
</jnlp> 

Here is my manifest file:

Permissions: all-permissions
Trusted-Library: true
Codebase: *

When I try to open it in windows 8.1 or windows 7 there is no problem, everything works as expected.

But when i try to open it in Windows 10, applet cannot get the parameters which are defined in JNLP file. (I have tried it with j8u45 and j8u51)

I am trying to get the parameter with this method:

String java.applet.Applet.getParameter(String name)

Example: myTestApp.getParameter("TestParam")

Here is the stacktrace of the exception

java.lang.NullPointerException
    at test.XApplicationVariables.getParameters(XApplicationVariables.java:527)
    at test.MyApplet.init(TestApplet.java:71)
    at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.init(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

How can I fix this problem? is there a workaround?

1

There are 1 best solutions below

0
e13420xx On

Problem causes the way JRE handles parameters.

Suppose there is a parameter "Ip". JRE reads the parameters and lowercase them with current locale (in my case it was Turkish).

This changes "Ip" parameter to "ıp "

Therefore, when I tried to read Ip or ip in my application it does not find it.