JNLP (Java Network loading Protocol) was originally very simple

Source: Internet
Author: User

Java Network launching protocol (JNLP, Java Network loading protocol ).

What is JNLP? Java provides a way for you to directly execute Java applications through a browser, which enables you to directly open a Java application through a URL Connection on a web page. the benefit is worth noting. If your Java application is released in the form of JNLP, if you do not need to release a version to all users after the version upgrade, you only need to update the server version, this is equivalent to giving Java applications the advantages of Web applications.

How to Use JNLP:
1. Package Your application into an executable JAR file and put it in an accessible web directory, such as apptest. jar.
You can use the ant script, or you can use the jar tool to package it.
<Jar destfile = "$ {DESC. dir}/$ {youapp. jarname}" update = "true" compress = "true">
<Manifest>
<Attribute name = "Main-class" value = "" com. youapp. mainclass "/>
</Manifest>

<Fileset dir = "$ {class. dir}">
...
</Fileset>

</Jar>

2. Compile an XML file test. JNLP with the following content:
<? XML version = "1.0" encoding = "UTF-8"?>
<JNLP codebase = "http: // localhost/yousite/" name = "seatingchartbuilder"
Href = "http: // localhost/yousite/test. JNLP">
<Information>
<Title> seating chart builder </title>
<Vendor> etix.com, Inc. </vendor>
<Offline-allowed/>
<Description> An application to seating chart builder! </Description>
</Information>
<Application-Desc main-class = "com. youapp. mainclass"/> <! -- Here is the name of your app entry -->
<Security>
<All-permissions/>
</Security>
<Resources>
<J2se version = "1.4 +"/>
<Jar href = "apptest. Jar"/> <! -- Here is your packaged application -->
</Resources>
</JNLP>

3. You must sign your JAR File
Use keytool on the command line to generate a keystore file.
Keytool-genkey-keystore you. keystore-alias youapp

Use jarsigner to sign the command line. The keystore password must be generated at this time.
Jarsigner-keystore you. keystore apptest. Jar youapp

OK. Now, put the apptest. jar file in the/yousite directory of your web application.
Http: // localhost/yousite/test. JNLP can start your application,
At startup, a dialog box will pop up asking you to confirm the signature. Click Yes.

Here let's take a look at Sun's demo: http://java.sun.com/products/javawebstart/demos.html
Reference http://www.yeegle.com/articleview/33954.aspx

 

This article from csdn blog: http://blog.csdn.net/zmxj/archive/2005/02/22/297649.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.