Documentation

The Java™ Tutorials
Hide TOC
Deploying a Java Web Start Application部署JavaWebStart应用程序
Trail: Deployment
Lesson: Deployment In-Depth
Section: Deployment Toolkit

Deploying a Java Web Start Application部署Java Web Start应用程序

You can deploy Java Web Start applications by using the createWebStartLaunchButton function of the Deployment Toolkit script. 您可以使用部署工具包脚本的createWebStartLaunchButton函数部署Java Web Start应用程序。Java Web Start applications are launched using Java Network Launch Protocol (JNLP) The createWebStartLaunchButton function generates a link (HTML anchor tag - <a>) to the Java Web Start application's JNLP file.Java Web Start应用程序使用Java网络启动协议(JNLP)启动createWebStartLaunchButton函数生成指向Java Web Start应用程序JNLP文件的链接(HTML锚标记<a>)。

This generated anchor tag is the Java Web Start application's Launch button button. 生成的锚标记是Java Web Start应用程序的Launch button按钮。When the end user clicks the Launch button, the Deployment Toolkit script ensures that the appropriate Java Runtime Environment (JRE) software is installed and then launches the Java Web Start application.当最终用户单击启动按钮时,部署工具包脚本确保安装了适当的Java Runtime Environment(JRE)软件,然后启动Java Web Start应用程序。


Note: Depending on the type of browser, you might be unable to view the HTML generated by the Deployment Toolkit script when you try to view the source for the web page. 根据浏览器的类型,在尝试查看网页的源代码时,可能无法查看部署工具包脚本生成的HTML。To view the generated HTML, try saving the HTML page after it has been loaded, or use a tool such as Firebug (a Mozilla Firefox add-on).要查看生成的HTML,请尝试在加载HTML页面后保存该页面,或使用Firebug(Mozilla Firefox插件)等工具。

Note: If the client does not have the required minimum version of the JRE software, the Deployment Toolkit script redirects the browser to http://www.java.com to allow users to download the latest JRE software. 如果客户端没有所需的JRE软件最低版本,部署工具包脚本会将浏览器重定向到http://www.java.com允许用户下载最新的JRE软件。

Function signature:功能签名: createWebStartLaunchButton: function(jnlp, minimumVersion) or createWebStartLaunchButton: function(jnlp)

Parameters:参数:

Usage:用法:


Note: When deploying by using any of the previously described createWebStartLaunchButton functions, you must specify an absolute codebase in the Java Web Start application's JNLP file. 使用前面描述的任何createWebStartLaunchButton函数进行部署时,必须在Java Web Start应用程序的JNLP文件中指定绝对代码库。This enables the Java Web Start application to be launched from the command line with the javaws <path/to/local JNLP file> command. 这使Java Web Start应用程序能够通过javaws <path/to/local JNLP file>命令从命令行启动。

Previous page: Embedding JNLP File in Applet Tag
Next page: Changing the Launch Button