codebase
Attributecodebase
AttributeBeginning in the Java SE 6 update 18 release, you do not have to specify an absolute path for the
codebase
attribute in the Java Web Start application's Java Network Launch Protocol (JNLP) file. You can develop and test your applications in different environments without having to modify the path in thecodebase
attribute.The following functions of the Deployment Toolkit script can be used to deploy Java Web Start applications:
launchWebStartApplication
– Use this function in an HTML link to deploy your Java Web Start application.createWebStartLaunchButtonEx
– Use this function to create a Launch button for your Java Web Start application.
Note: To run, Java Web Start applications deployed by using the previously specified functions require at least the Java SE 6 update 18 release. If the client does not have at least the Java SE 6 update 18 release, the functions instruct the user to install the required Java Runtime Environment (JRE) software before launching the Java Web Start application.Function signature:
launchWebStartApplication: function(jnlp)
Parameter:
jnlp
– The path to the JNLP file containing deployment information for the Java Web Start application. This path can be relative to the web page in which the Java Web Start application is deployed.Usage:
In the following example, the
launchWebStartApplication
function is invoked in thehref
attribute of an HTMLanchor (a)
tag.The
JNLP file is used to deploy the Dynamic Tree Demo application.
dynamictree-webstart-no-codebase.jnlp
<script src="http://www.java.com/js/deployJava.js"></script> <a href="javascript:deployJava.launchWebStartApplication('dynamictree-webstart-no-codebase.jnlp');">Launch</a>The Java Web Start application is launched when the user clicks the resulting HTML link.
Function signature:
createWebStartLaunchButtonEx: function(jnlp)
Parameter:
jnlp
– The path to the JNLP file containing deployment information for the Java Web Start application. This path can be relative to the web page in which the Java Web Start application is deployed.Usage:
The following example shows the usage of the
createWebStartLaunchButtonEx
function.The
JNLP file is used to deploy the Dynamic Tree Demo application.
dynamictree-webstart-no-codebase.jnlp
<script src="http://www.java.com/js/deployJava.js"></script> <script> var jnlpFile = "dynamictree-webstart-no-codebase.jnlp"; deployJava.createWebStartLaunchButtonEx(jnlpFile); </script>The Java Web Start application is launched when the user clicks the resulting Launch button.
Open
in a browser to view the Dynamic Tree Demo application that is deployed by using the functions described in this topic.
JavaWebStartAppPage_No_Codebase.html
Download source code for the Dynamic Tree Demo example to experiment further.