Easy to Learn Java: Programming Articles, Examples and Tips

Start with Java in a few days with Java Lessons or Lectures


Code Examples

Java Tools

More Java Tools!

Java Forum

All Java Tips


Submit News
Search the site here...
Search the JavaFAQ.nu
1000 Java Tips ebook

1000 Java Tips - Click here for the high resolution copy!1000 Java Tips - Click here for the high resolution copy!

Java Screensaver, take it here

Free "1000 Java Tips" eBook is here! It is huge collection of big and small Java programming articles and tips. Please take your copy here.

Take your copy of free "Java Technology Screensaver"!.

More about JNLP - Java Network Launching Protocol...

JavaFAQ Home » Networking Go to all tips in Networking

Bookmark and Share

More about JNLP - Java Network Launching Protocol...

The Java Network Launching Protocol is a new Java protocol to allow remote applications to be downloaded and run on a client machine. All necessary class files, images, etc, can be downloaded, and do not need to be present on the client machine beforehand. This chapter looks at JNLP and compares it to Jini, and shows how the two can be used together to get the advantages of both

The concept of applets was one of the initial boosts for Java's success. However, while Java has gone from strength to strength, applets have fallen by the wayside. This is partly because the sandbox model is so tight that there is little you can do with them, but also because the Java runtime engines in the different browsers were inconsistent and often buggy, frequently causing the browser to crash.

THE JNLP is another approach to this type of problem, where remote code is sent to a browser for execution. Instead of running within the browser though, the code is run in a manner similar to CGI scripts by passing it to a Java runtime engine that runs as a separate application. There are plenty of mechanisms within JNLP to ensure safety in a variety of sandbox (or freer) models, and also to ensure that resources required are present (such as a late enough version of the Java runtime).

A JNLP application is described by a JNLP file, which is an XML do*****ent. Typically, this do*****ent will be downloaded by a Web browser. The browser itself will not know what to do with this file, so it will pass it to a "JNLP helper" to deal with. This is a standard browser technique, and allows a browser to call a Postscript viewer such as ghostscript to handle Postscript files, Adobe acrobat to handle PDF files, and so on. The JNLP helper will read the list of resources required and download them if necessary. It will also check that all constraints such as version of the Java runtime are satisfied. Once this is all done, the helper will start the Java application running.

A minimal JNLP file can be

File Classifier Application This states the codebase from where all resources will be drawn, the jar file containing the classes and the main class of an application (rather than an applet). This is enough for the helper to run the application.

3. Jini and JNLP Comparison

On the face of it, Jini and JNLP appear to occupy similar spaces in that they both allow code to be migrated to a client machine and to execute there. The following table summarises some of the differences and similarities

downloads a service downloads an application
a client must be running to request a service a browser must be running which calls a helper to start the application
each service looks after itself, independently of any clients each JNLP file specifies all required parts of an application; if any part changes, the JNLP file must be updated
the client may need to know the location of a lookup service, but not of any service the user of a JNLP application must know the URL of the JNLP file
no generic client generic JNLP helper
4. Combining Jini and JNLP

The whole book (Jan Newmarch's Guide to Jini Technologies) and chapter "Java Network Launching Protocol" you can read here.

 Printer Friendly Page  Printer Friendly Page
 Send to a Friend  Send to a Friend

.. Bookmark and Share

Search here again if you need more info!
Custom Search

Home Code Examples Java Forum All Java Tips Books Submit News, Code... Search... Offshore Software Tech Doodling

RSS feed Java FAQ RSS feed Java FAQ News     

    RSS feed Java Forums RSS feed Java Forums

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest 1999-2006 by Java FAQs Daily Tips.

Interactive software released under GNU GPL, Code Credits, Privacy Policy