编写:徐建祥(netpirate@gmail.com)
时间:2006-03-09 01:15
来自:http://www.anymobile.org
Java 网络加载协议 (JNLP): 是 Java Web Start 的一个组成协议,通常定义为一种通过网络并穿透防火墙传输驻留于服务器的应用程序、并在客户机上启动它的机制。--算是一种安全的同步机制
Java(TM) Web Start:是一种简化 Java 应用程序部署的技术,让用户不需要复杂的安装过程,单击 Web 浏览器就可以启动全功能的应用程序。J2SE 捆绑了 Java Web Start。
D/S结构(DestktopApplication/ServerApplication):客户端使用Swing,服务器端使用Servlet,采用Swing和Servlet来交换数据,可以采用标准的HTTP协议来通讯,来交换数据。
JNLP 文件其实是一个xml文件,描述了产品信息,使用的jar文件网址和 main-class 定义等。
客户端点击 JNLP 文件的连接,就会激活本地的 Java Web Start,选择下载 jar 包后,下载完备就可以运行相关的程序。可以操作本地数据,其实是把 jar 包下载到本地(每次允许都会自动更新),调用远程的 servlet 来交互数据。
样例 JClaim 的jclaimsf.jnlp 代码清单:
<?
xmlversion="1.0"encoding="utf-8"
?>
<!--
~Copyright(c)2006,ITBSLLC.AllRightsReserved.
~
~ThisfileispartofJClaim.
~
~JClaimisfreesoftware;youcanredistributeitand/ormodify
~itunderthetermsoftheGNUGeneralPublicLicenseaspublishedby
~theFreeSoftwareFoundation;version2oftheLicense.
~
~JClaimisdistributedinthehopethatitwillbeuseful,
~butWITHOUTANYWARRANTY;withouteventheimpliedwarrantyof
~MERCHANTABILITYorFITNESSFORAPARTICULARPURPOSE.Seethe
~GNUGeneralPublicLicenseformoredetails.
~
~YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense
~alongwithJClaim;ifnot,finditatgnu.orgorwritetotheFreeSoftware
~Foundation,Inc.,51FranklinSt,FifthFloor,Boston,MA02110-1301USA
~
-->

<
jnlp
spec
="1.0+"
codebase
="http://jclaim.sourceforge.net"
href
="/jclaimsf.jnlp"
>
<
information
>
<
title
>
JCLAIM
</
title
>
<
vendor
>
ITBSLLC
</
vendor
>
<
description
>
JavaCompliantLoggingandAuditingInstantMessenger.
</
description
>
<
description
kind
="short"
>
JCLAIM
</
description
>
<
icon
href
="/logo.gif"
/>
</
information
>
<
security
>
<
all-permissions
/>
</
security
>
<
resources
>
<
j2se
version
="1.5"
max-heap-size
="25m"
/>
<
jar
href
="jclaim.jar"
main
="true"
/>
<
jar
href
="cos.jar"
/>
<
jar
href
="jaimlib.jar"
/>
<
jar
href
="jazzy.jar"
/>
<
jar
href
="jdic.jar"
/>
<
jar
href
="joscar.jar"
/>
<
jar
href
="jsocks.jar"
/>
<
jar
href
="msnm.jar"
/>
<
jar
href
="oscar.jar"
/>
<
jar
href
="smack.jar"
/>
<
jar
href
="ymsg.jar"
/>
</
resources
>
<
resources
os
="Mac"
>
<
jar
href
="lib/mac/jdic_misc.jar"
/>
</
resources
>
<
resources
os
="Windows"
>
<
jar
href
="lib/win32/jdic_misc.jar"
/>
<
jar
href
="lib/win32/jdic_stub.jar"
/>
<
nativelib
href
="lib/win32/native.jar"
/>
</
resources
>
<
resources
os
="Linux"
>
<
jar
href
="lib/linux/jdic_stub.jar"
/>
<
nativelib
href
="lib/linux/native.jar"
/>
</
resources
>
<
resources
os
="SunOS"
arch
="x86"
>
<
jar
href
="lib/sunos/jdic_stub.jar"
/>
<
nativelib
href
="lib/sunos/native.jar"
/>
</
resources
>
<
resources
os
="SunOS"
arch
="sparc"
>
<
jar
href
="lib/sunos/jdic_stub.jar"
/>
<
nativelib
href
="lib/sunos/native.jar"
/>
</
resources
>

<
application-desc
main-class
="com.itbs.aimcer.gui.Main"
>
</
application-desc
>
</
jnlp
>
资源:
Java Web Starthttp://java.sun.com/products/javawebstart/developers.html
动态 JNLPhttps://www6.software.ibm.com/developerworks/cn/education/java/j-dynjnlp/tutorial/j-dynjnlp-1-1.html
本文介绍了JavaWebStart技术及其核心组成部分Java网络加载协议(JNLP),解释了如何利用JNLP文件实现应用程序的自动下载和更新,并展示了实际的JNLP文件示例。
4009

被折叠的 条评论
为什么被折叠?



