Really strange problem with my Tomcat...PLEASE HELP!

hi,

I am getting very confused. The root directory is:

C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\ROOT

If I go to:

http://localhost:8080/

I get the Tomcat index.jsp.

So far, so good.

If I now create a directory in this directory, ex0102, and then go,

http://localhost:8080/ex0102/

it works. So thats good.

Next thing I did was to go to:

C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\

I placed a war in here from an example in my book, ex0102.war. I then deployed it. Now when I went to

http://localhost:8080/ex0102, it found the stuff in this new ex0102, and not the ex0102 in the ROOT. Even when I deleted the new ex0102, it is not finding the original ex0102 in the ROOT, even though it is still there.

Why?

Thanks.

[919 byte] By [] at [2007-10-2 14:49:01]
# 1

Because thats how it works.

It treats the first bit in the path as the "context"

Tomcat tries to match against context first. If it finds one, it uses that webapp.

If it can't, then it uses the default context "" - which is defined under the ROOT webapp.

That explains why the webapp /ex0102 takes precedence over /ROOT/ex0102

>Even when I deleted the new ex0102, it is not finding the original

>ex0102 in the ROOT, even though it is still there.

Make sure you delete both

- the war file

- the created directory in webapps.

Restart Tomcat.

evnafetsa at 2007-7-13 13:25:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thank you so much. That makes a lot of sense.
evnafetsa at 2007-7-13 13:25:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...