You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Charles Webber <ch...@earthlink.net> on 2001/08/30 03:35:47 UTC

It worked - Can someone explain why?

I am working through a book on servlets and JSPs.  JSPs and beans are pretty
easy, and I understand how things fit together  - still want to work on some
JDBC stuff, but that's later.
In the meantime, I wrote a servlet as part of a package called coreservlets.
I finally went through the examples that came with Tomcat and noticed in the
source that it didn't use packages and figured out both how to invoke my
servlets and where to place the class file so that it would work.  The
question is why it works this way - what is going on under the covers?
I placed my servlet class file in a directory like
$TOMCAT_HOME/webapps/examples/WEB-INF/classes/coreservlets/name.class.  On
the URL in my browser, I typed in the following:
http://host/examples/servlet/coreservlets.name - and it worked!!!
So the confusion I have is due to the fact that the directory path names
don't match where the servlet is located.  Can anyone explain this?  I'm
sure this is pretty straightforward - and if some document points this
ut  - if you could point me to that I'll take it from there.
Thanks.