在布署Java Web Start前先确认Web Server支持JNLP文件类型。添加.jnlp扩展名的确认,可以通过添加MIME类型为“application/x-java-jnlp-file”进行设置。
创建JNLP文件
- 运行Java Web Start的关键是Java Network Launching Protocol,即JNLP文件。 JNLP是一个包含Java Web Start运行属性的XML文件。
-
例:
-
<?xml version="1.0" encoding="utf-8"?>
-
-
<jnlp spec="1.0+"
-
codebase="http://java.sun.com/docs/books/tutorialJWS/deployment/webstart/examples/"
-
href="Notepad.jnlp">
-
<information>
-
<title>Notepad Demo</title>
-
<vendor>The Java(tm) Tutorial: Sun Microsystems, Inc.</vendor>
-
<description>Notepad Demo</description>
-
<homepage href="http://java.sun.com/docs/books/tutorial/deployment/webstart/running.html"/>
-
<description kind="short">ClickMeApp uses 3 custom classes plus several
-
standard ones</description>
-
<offline-allowed/>
-
</information>
-
<resources>
-
<jar href="Notepad.jar"/>
-
<j2se version="1.6+"
-
href="http://java.sun.com/products/autodl/j2se"/>
-
</resources>
-
<application-desc main-class="Notepad"/>
-
</jnlp>
放置应用程序到Web Server
- 放置应用程序的所有Jar文件及JNLP文件到Web Server, 必需确保Jar文件是放置到JNLP文件jar单元的href属性指定的位置当中。
创建Web Page
- 创建一个页面用于用户访问你的应用程序,其中只是一个简单的链接,但是同时应该添加用于安装Java Web Start的链接。
-
添加一个引用JNLP文件的链接,例如:<a href="Notepad.jnlp">Launch Notepad Application</a>
- 添加用于安装Java Web Start的链接。参考:Java Web Start Guide
相关文章:
-
2021-08-01
-
2022-01-11
-
2021-08-11
-
2022-01-18
-
2022-12-23
-
2021-08-11
-
2022-01-10
猜你喜欢
-
2021-08-08
-
2021-12-08
-
2021-08-21
-
2022-12-23
-
2021-11-17
-
2022-12-23
相关资源
-
下载
2023-01-10
-
下载
2021-06-24
-
下载
2023-02-26
-
下载
2023-01-09