views:

29

answers:

1

Assuming you have developed a webapp that is to be used locally by the client, what are the steps required to distribute it?

  • Use an embedded web server

Glassfish v3 comes with an embedded version on the original distribution which you can use.

  • Use an embedded database

First thing that comes to mind is Apache Derby

Now the trickiest part (which I don't have an answer) is how to provide a file that the user just double clicks and launches the webapp.

Should you provide a swing application with an embedded browser? That means you will have to take into account the quirks of the specific browser that you are developing. Are they up to date as their desktop counterparts?

Should you open the default browser providing the URL? Is there a way to ensure the browser did open correctly? How do you on on cleaning up any resources when the client closes the window?

A: 

The Hudson project uses the Winstone servlet container to produce a war file that can also be run directly as a JAR-file. You may want to see how they do it.

Thorbjørn Ravn Andersen
Winstone looks great in terms of minimizing the distribution size if all you need is a servlet environment.With hudson you still have to manually open the desktop browser to localhost. Plus I'm not sure if Java on Windows (or linux) associates the war file with the java executable to be run on double click. On Windows 7, Java 1.6_20 I had to explicitly run the java -jar command.
Cue