This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Welcome file list and directory listing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Welcome file list and directory listing" Watch "Welcome file list and directory listing" New topic

Welcome file list and directory listing

Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2591

Not the regular simple problem. I have url pattern such as this -

now this aaa, bbb & NNNN are unknown to me (NNNN is a physical directory though -- but there are several), and my servlet filter does the needful to dispatch the corrrect URL from this. Now my problem is -- when the user doesn't enter at the end - it ends up showing the directory listing which I want to prevent and want to serve page instead. I *cannot* add index.jsp in all those NNNN directories as they are generated on fly.

I have added following configuration to welcome-file list in my web.xml, but it doesn't serve from there. What can I do to fix this?

- Manish
Steve Luke

Joined: Jan 28, 2003
Posts: 4181

1) Don't use / as the URL for the welcome file. You want it to be

2) What version of Tomcat are you using? I know in older versions there was a problem using non-physical files as welcome files. But this was fixed I think by Tomcat 5.

I agree. Here's the link:
subject: Welcome file list and directory listing
It's not a secret anymore!