Note that there are some explanatory texts on larger screens.

plurals
  1. PODynamic JNLP fetching file from server
    text
    copied!<p>I want to serve up a dynamic JNLP with customized launch <code>&lt;argument&gt;</code> tags for a user.</p> <p>After much hassle, it's almost working.</p> <p>The user logs into the site, downloads a JNLP which is customized for the user. Java Web Start launches using the downloaded, customized JNLP file.</p> <p>However, the first a user launches the app, Java Web Start fetches the "master" JNLP file from the server, by using the <code>href</code> attribute embedded in the .jnlp file. This doesn't contain the user's custom <code>&lt;argument&gt;</code> tag, and things break.</p> <p>Is there a way to tell JNLP to use the local JNLP file and not fetch it from the server?</p> <p>Here's my <code>APPLICATION_TEMPLATE.jnlp</code>:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;!DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc//DTD JNLP Discriptor 1.5//EN" "http://java.sun.com/dtd/JNLP-1.5.dtd"&gt; &lt;jnlp spec="6.0+" codebase="http://localhost/jnlp" version="1234" href="http://localhost/jnlp/app.jnlp"&gt; &lt;information&gt; &lt;title&gt;JNLPHelper&lt;/title&gt; &lt;vendor&gt;Yoyodyne, Inc.&lt;/vendor&gt; &lt;offline-allowed/&gt; &lt;shortcut online="true" install="false"&gt; &lt;desktop/&gt; &lt;menu submenu="Yoyodyne, Inc."/&gt; &lt;/shortcut&gt; &lt;association extensions="jnlphelper" mime-type="application-x/jnlphelper"/&gt; &lt;/information&gt; &lt;security&gt; &lt;all-permissions/&gt; &lt;/security&gt; &lt;update check="timeout" policy="always"/&gt; &lt;resources&gt; &lt;java initial-heap-size="32M" max-heap-size="256M" version="1.6+"/&gt; &lt;!--&lt;j2se version="1.6+" java-vm-args="-esa -Xnoclassgc"/&gt;--&gt; &lt;jar href="JNLPHelper.jar"/&gt; &lt;/resources&gt; &lt;application-desc main-class="com.prosc.msi.jnlp.JNLPHelper"&gt; &lt;argument&gt;*&lt;/argument&gt; &lt;/application-desc&gt; &lt;/jnlp&gt; </code></pre> <p>This example file is hosted on my webserver, which during testing is <code>localhost</code>. The user downloads a customized JNLP with <code>&lt;argument&gt;foo&lt;/argument&gt;</code> replacing <code>&lt;argument&gt;*&lt;/argument&gt;</code>.</p> <p>I tried removing the <code>href</code> attribute entirely from the <code>&lt;jnlp&gt;</code> tag. This almost worked, but the application prompts to re-install itself each time, and my desktop icon is removed and re-added.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload