Skip to main content

Applet smarter than JNLP?

4 replies [Last post]
ilyich
Offline
Joined: 2005-09-26

I met some problem with JNLP:
Our application is deployed from proprietary HTTP servers of our clients.
When we installed our application as Applet, all the files were just copied to HTTP server folder and this worked (better or worse)
Now, to install our application with JNLP we need to put the HOSTNAME of HTTP server both in JNLP page and JRE-version-checking html page (codebase, jar and jnlp paths). Moreover, if the hostname of the server is changed - the change should be done in these files once again.
This is confusing. Why couldn't I just set - the place where you downloaded the JNLP from is the codebase (just like in Applet).
I know, there is possibility of JSP, but this makes the HTTP server installation more difficult...
Are there other ways to solve this problem?
Thanks in advance

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
neilweber
Offline
Joined: 2003-06-25

Check out the sample JNLP servlet that comes with the JDK. According to its README, it supports

* Automatic installation of the codebase URL into JNLP files, thus
eliminating manual management of hard-coded URLs into JNLP files.

This isn't tricky: it just replaces some keywords in the JNLP file. So if you don't want to use a servlet container, you could use a CGI script or probably some Apache wizardry.

evickroy
Offline
Joined: 2004-07-23

The JnlpDownloadServlet code can be found in the open source project at https://deployment.dev.java.net/ if you are interested in going that route.

Erik

neilweber
Offline
Joined: 2003-06-25

Erik,

Do you know if the JnlpDownloadServlet in the deployment project differs from the one that comes with the JDK?

Neil

evickroy
Offline
Joined: 2004-07-23

Well... yes. Slightly. The one in the Deployment project is the same as the source from JDK 5.0, but it includes a new feature that allows you to define your own handler for token replacement. So instead of only being able to replace $$codebase, $$name, and $$context, you can supply your own substitution handler to replace any tokens you want.

Erik