| Author |
Welcome file question
|
Raf Szczypiorski
Ranch Hand
Joined: Aug 21, 2008
Posts: 383
|
|
Hi. I have a wlecome file defined like this:
This is a jnlp file that will start a Java Web Start client.
The problem - this doesn't work - I get a 404 as a result. The file is in where it should be. The specs say that welcome file can be a physical static resource (as here) or a servlet mapping. Somehow, this doesn't work for me. I am using Glassfish 2.1 so basically Tomcat under the hood.
As a workaround, I created a start.jsp file that has this line:
and used this as a welcome file. This works fine, but is kind of a hack, and I am also curious why the first approach is not working.
Thanks.
|
 |
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12271
|
|
Is that welcome file list in the default web.xml or the web.xml for a particular application?
How is the extension .jnlp mapped to a handler?
Are you executing Glassfish from an IDE or directly?
Bill
|
Java Resources at www.wbrogden.com
|
 |
Raf Szczypiorski
Ranch Hand
Joined: Aug 21, 2008
Posts: 383
|
|
1. It is a welcome file in the web.xml for a particular web module that is part of an EAR
2. Initially I didn't have any explicit mapping (Tomcat has it in its web.xml), but after your post I mapped it in the web.xml for the web module. No change. I don't think mapping a handler is important here, as a mime-type is used only after the file is served, on the client side (or did you mean something else when you said mapping a handler?). Without any mime type, the file would probably get served as plain text, no meter what was inside (see below).
3. I was executing Glassfish from within Eclipse 3.5. I exported an EAR and deployed it outside any IDE, and got the same behaviour.
The thing I don't understand is how this file is not found, whereas a jsp in the same dir is found.
Now, I copied start.jnlp to start.whatever in the same directory, set is as a welcome file, and guess what, it serves the file as a plain text file, so it can be found.
As a side-question, is Glassfish really using Tomcat under the hood? I could not find any files within Glassfish installation directory that would suggest Tomcat.
Thanks,
Raf
|
 |
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12271
|
|
Now, I copied start.jnlp to start.whatever in the same directory, set is as a welcome file, and guess what, it serves the file as a plain text file, so it can be found.
Well that is a mystery to me too. Maybe this should be moved to the JNLP and Webstart Forum.
Bill
|
 |
 |
|
|
subject: Welcome file question
|
|
|