2 Replies Latest reply on Nov 7, 2002 6:22 PM by Don Vail

    servlett for root of WAR application

    Don Vail Newbie

      I have an application called test.war that I can get to via localhost:8080/test/index.html

      I would like to have a servlet get called when I go to localhost:8080/test or localhost:8080/test/

      This seems simple, but I get a directory listing instead of my servlet being called.

      Any help would be appreciated.

        • 1. Re: servlett for root of WAR application
          Don Laidlaw Newbie

          I did this before by creating an index.html file (add index.html as a welcome file) and having it forward to where the servlet is mapped.

          • 2. Re: servlett for root of WAR application
            Don Vail Newbie

            Today I am wiser.

            It turns out that my problem was that I had jboss installed on a windows machine under "c:\program files", and this causes Jboss to not work under certain circumstances. Once I moved Jboss to the "c:\bin" directory I could do the following:

            1) use welcome-file-list
            2) use run.bat unmodified
            3) use the Eclipse Jboss plug-in (from easie gdnuitec.com)

            none of these things was working before. I hope that this posting helps someone else avoid my mistake.

            I got the root servlet working by changing my web.xml to a) map a servlet to /foo
            b) setting my welcome file to "foo"
            c) create a dummy file called foo in the root directory.

            This allowed me to have root access go to my desired servlet. The dummy file is not ever really accessed, but it seems to be neccessary. Without it, my servlet would not get called.