5 Replies Latest reply on Nov 27, 2002 4:16 PM by jcorbin

    welcome-file-list ignored in web.xml

    alphafoo

      Hi-
      I have a working web application that uses a JBoss/Tomcat/Maverick/Velocity stack. My web.xml file has a <welcome-file-list> element in it, but it seems to be ignored, so I get a directory listing instead. I have Tomcat4.0 embedded in JBoss2.4.3, and I'm not sure if I need to set this property somewhere else or not.
      Searching on Google got me some hints that JBoss/resin ignored the <welcome-file-list> tags, so I thought maybe Tomcat was doing the same.
      Does anyone know what I need to do to get this tag recognized?

        • 1. Re: welcome-file-list ignored in web.xml
          p_d_austin

          The only time I have seen this is if you put the welcome-file-list tag in the wrong place in the web.xml file. Check out the dtd for the web.xml file and check you have it in the right place.

          Paul

          • 2. Re: welcome-file-list ignored in web.xml
            alphafoo

            Hmmm, I have it at the end of the file, right after servlet-mapping, and that seems consistent with the spec posted here: http://java.sun.com/j2ee/dtds/web-app_2_2.dtd


            I have this at the end of my file...
            <servlet-mapping>
            <servlet-name>dispatcher</servlet-name>
            <url-pattern>*.m</url-pattern>
            </servlet-mapping>

            <welcome-file-list>
            <welcome-file>home.m</welcome-file>
            </welcome-file-list>
            </web-app>

            What else could it be?

            • 3. Re: welcome-file-list ignored in web.xml
              alphafoo

              In case anyone else goes down this path, I finally figured out what was going wrong--- the welcome-file I specify (home.m) is an URL but not an actual file on the filesystem, which is what needs to be specified. Tomcat was looking for a home.m file, which didn't exist in the content directory, so it just gave up and showed the directory tree.

              I guess the solution is to have an index.html file as the welcome file and just have it redirect to the /home.m URL.

              • 4. Re: welcome-file-list ignored in web.xml
                tcabot

                Strangely enough, try creating a zero length home.m file. This worked for me.

                • 5. Re: welcome-file-list ignored in web.xml
                  jcorbin

                  I ran across a slightly different problem....I specified my welcome-file as index.jsp and verified the file existed in the correct location in the war file and I still get the directory listing. Does anyone have ideas why it would get ignored?

                  TIA