Wildcards in jnlp template file

Posted by Andy on Stack Overflow See other posts from Stack Overflow or by Andy
Published on 2013-11-09T21:50:03Z Indexed on 2013/11/09 21:53 UTC
Read the original article Hit count: 1118

Filed under:
|
|
|
|

Since the last security changes in Java 7u40, it is required to sign a JNLP file. This can either be done by adding the final JNLP in JNLP-INF/APPLICATION.JNLP, or by providing a template JNLP in JNLP-INF/APPLICATION_TEMPLATE.JNLP in the signed main jar.

The first way works well, but we would like to allow to pass a previously unknown number of runtime arguments to our application.

Therefore, our APPLICATION_TEMPLATE.JNLP looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<jnlp codebase="*">
    <information>
        <title>...</title>
        <vendor>...</vendor>
        <description>...</description>
        <offline-allowed />
    </information>
    <security>
        <all-permissions/>
    </security>
    <resources>
        <java version="1.7+" href="http://java.sun.com/products/autodl/j2se" />
        <jar href="launcher/launcher.jar" main="true"/>
        <property name="jnlp...." value="*" />
        <property name="jnlp..." value="*" />
    </resources>
    <application-desc main-class="...">
        *
    </application-desc>
</jnlp>

The problem is the * inside of the application-desc tag.

It is possible to wildcard a fixed number of arguments using multiple argument tags (see code below), but then it is not possible to provide more or less arguments to the application (Java Webstart will no start with an empty argument tag).

    <application-desc main-class="...">
        <argument>*</argument>
        <argument>*</argument>
        <argument>*</argument>
    </application-desc>

Does someone can confirm this problem and/or has a solution for passing a previously undefined number of runtime arguments to the Java application?

Thanks alot!

© Stack Overflow or respective owner

Related posts about java

Related posts about security