users@glassfish.java.net

Re: Glassfish and Java Web Start

From: <glassfish_at_javadesktop.org>
Date: Sat, 14 Jun 2008 10:21:17 PDT

My advice is this:

Do not use the autodeploy directory for purposes other than autodeployment. It is not a general holding area but, as you noticed, GlassFish monitors that directory and automatically deploys apps it finds there.

One way to do what you want is this:

1. Package your JNLP file(s) and the JAR(s) for the application into the web app's WAR file.

2. You control the context-root for the application by the setting in the web.xml, or the value you specify on the asadmin deploy command or in the admin GUI, or (the default if not set any of those ways) the name of the war file.

3. Deploy the WAR.

4. Launch the JNLP file using this URL: http://host:port/<web-app-context-root>/<relative-path-within-WAR-to-main-JNLP-file>

This quick and dirty approach will work but it requires you to hard-code the codebase into the JNLP file.

If you want to avoid that you can use the example JNLPDownloadServlet that comes with Java Web Start as part your app. You can then use $$codebase in your JNLP, and the servlet replaces that with the actual value once you have deployed the web app. See http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/downloadservletguide.html for more about the download servlet.

Hope that helps.

- Tim
[Message sent by forum member 'tjquinn' (tjquinn)]

http://forums.java.net/jive/thread.jspa?messageID=280342