Posted by mthornton
on December 10, 2006 at 3:25 AM PST
I recently acquired a little NAS device which also runs Apache and PHP. So I thought about hosting some WebStart applications on it. Like many cheap commercial services it doesn't allow much in the .htaccess file, and of course I can't use the JNLP download servlet as it doesn't run Java either.
I found some simple suggestions that allow the correct MIME type to be supplied by using a bit of PHP at the beginning of the JNLP file, but that doesn't supply a timestamp nor does it allow versioned downloads.
A few hours later and I have a PHP script which adds the timestamp, gives 304 responses if the client's file is already up to date, and can do versioned downloads (a bit more work needed on this bit). The current version also logs all the jnlp requests to a file on the web server.
Is anyone interested in this?
Incidentally this work was also prompted by some complaints that WebStart was slow to start. With my tests, using a versioned download, it isn't noticeably slower than starting a regular Java application of similar size.
Managing versioned jar files and jnlp files that reference them is a bit tedious. I have an ANT task that sets the version ids, renames the files as appropriate and fills in the attributes in the jnlp file. Now it is easy to let people continue using old versions. One JNLP file represents the current development, a release is achieved by merely copying that file to a new name which can then be used for as long as the jar versions it references are left on the server.
email@example.com (Every spammer in the universe already has this address, but not many make it through my spam filtering!)