Search code examples
javajakarta-eejnlpjava-web-start

JNLP load a jar from a relative address


<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+"
        codebase="**http://10.177.213.120:8080/Sample/**" href="sample-webstart.jnlp">
    <information>
        <title>Sample Screen</title>
        <vendor>John Doe</vendor>
    </information>
    <resources>
        <!-- Application Resources -->
        <j2se version="1.6+"
              href="http://java.sun.com/products/autodl/j2se"/>
        <jar href="Sample.jar" main="true" />

    </resources>

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

    <application-desc
         name="Screen"
         main-class="script.ScriptFrame">
     </application-desc>
     <update check="always"/>
</jnlp>

That codebase attribute, i am not able to load make this jnlp work without using the full-ip. Is there a way i can make that relative or change it dynamically.


Solution

  • Is there a way i can make that relative ..

    Only for an embedded applet.

    ..or change it dynamically.

    Sure, I guess the JNLP servlet would fill in the codebase dynamically, or would be able to with a slight tweak.