tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: Docbase inside the host appBasehas been specified, and will be ignored
Date Thu, 01 Jul 2010 09:29:20 GMT
Ockleford Paul (NHS Connecting for Health) wrote:
> Ok, so if I am just working in development and only using classes outside of a war or
a jar file how should I configure the application? If I remove those mappings how would tomcat
know that a request for /LabCatalogue should be matched to my code in c:\\webapps\LabCatalogue?
> 

To use another technical term, because. ;-)

More technically, because that is the default.
Here is a non-authoritative summary explanation.

Say a browser requests the URL "http://somehost.somedomain.com/somewebapp".
The first part "http://somehost.somedomain.com" just tells the browser with which host to

make a connection, and to use the HTTP protocol for it.
Then the browser, over that connection, sends a request with the rest, like :
GET /somewebapp HTTP/1.1

When Tomcat receives a request with that URL "/somewebapp", it looks under the directory 
which is specified as the "appBase" for that <Host> (*), for either a directory named

"somewebapp", or a .war file named "somewebapp.war".
It will do that /unless/ there is a Context element somewhere which tells it that it 
should look somewhere else.

By default also, under that directory, Tomcat is going to look for a "WEB-INF" directory,

and under that directory, for a directory "classes" and a directory "lib", where it 
expects to find the .class and .jar files of your application, respectively.

(*) by default, there is only one <Host> named "localhost", and its webapps directory
is 
the "webapps" directory under the Tomcat top installation directory.

For a more complete and correct explanation, you should read

http://tomcat.apache.org/tomcat-6.0-doc/deployer-howto.html
and
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

.. and the Servlet Specification.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message