As one can see, the applet support in JNLP is quite straightforward, even if tools such
as the Sun Plug-In will suffice in most cases when deploying applets.
Describing Extensions And Installers
When deploying Java code with JNLP, you will be dealing with application descriptors most of
the time. Despite that, there are several common situations where extension descriptors come
into play, as follows:
• When the basic installation procedure accomplished by a JNLP Client is not adequate. In
these cases, a proprietary installer (that is, code written by you) is needed. In Chapter 8,
we saw an example of how to launch a custom installer by means of JNLP. For installing
native resources—device drivers, native code or native libraries, and so on—an installer
descriptor JNLP file is needed.
• When our application relies on other libraries, and we prefer to keep those libraries
explicitly separated from the application JAR files. For example, let's imagine we work
for a games producer company, and our programs use some general-purpose graphics
and sound libraries. We package them into a set of JAR files on our Web server, so that
all our programs can access them. Our installer code for these libraries is launched to
install them properly. In these cases, a component descriptor JNLP file is needed.
Component descriptors are the analog of libraries in JNLP technology. We can even think of
component descriptor JNLP files as another way of deploying Java technology-based libraries ,
not (strictly-speaking) application code. Note that we can also specify native libraries, pre-
ferred JRE environments, and so on in a component descriptor.
Listing 9.11 shows the <component-desc> element.
L ISTING 9.11
The Component-Desc Element