You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Peter Becker <pe...@peterbecker.de> on 2005/11/04 16:45:47 UTC

Welcome files in subdirectories

[reposted since there was no answer yet]

Hello all,

I just started working on an existing webapp which runs under Tomcat 
4.x. Being a 5.5 user myself I tried deploying the app on Tomcat 5.5.4, 
but the application fails to work properly -- all static content is missing.

I tracked the problem down to different behaviour between the 
installations: the 4.1.31 installations we tried all use a HTTP redirect 
(302) to get the browser to move to the welcome pages, while Tomcat 
5.5.4 just forwards the request (i.e. delivers the page straight away 
with a 200). Problem here: the welcome files are in the jsp subdir (i.e. 
<welcome-file>jsp/index.jsp</welcome-file>), all static content is 
referred to by relative path (e.g. "../css/formate.css"). This works if 
there is a redirect, it fails if not.

While all examples I could find do not use subdirectories and I do 
understand that the option as used by Tomcat 5.5 is more efficient, 
putting the subdirectory in there seems to be ok with the spec (at least 
SRV.9.10 talks about "partial URLs").

We are considering to change the code to generate absolute URLs for the 
static content (changing it to drop the ".." would fail if the index 
page is accessed directly), but we wonder if there is some way to avoid 
this for now by setting something or another in the web.xml -- or some 
other trick we didn't come up with.

Any hints on what we could do? Are welcome pages in subdirectories evil?

Thanks,
   Peter


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org