Hi,

I suggest thinking of your mappings in two steps:
(a) get the mappings right *within* a context
(b) decide what context prefix you want.

If you ve a context with a path (ie url prefix) of
"mywebapp", then you can set up URLs as you desire
*within* that webapp. 

Configuring the url->servlet mappings (ie what servlet
is run when a user requests a particular url) is done
by defining <servlet-mapping> tags within the 
WEB-INF/web.xml file for your webapp. The urls
you define like this are all *relative* to the webapp
url, eg if you set up a mapping from "/foo" to the
java class "mypackage.myclass", then it must be
accessed by the user as "http://somehost/webappname/foo".

If you have a whole bunch of servlets, and you don't want
to enter separate servlet-mapping entries for each one, then
you may want to take advantage of the "invoker servlet" which
effectively sets up bulk url mappings for you, but doesn't give
you such fine control as creating invididual mappings.

Deciding whether you want the webapp to have a
prefix of "/" (ie be the root webapp) is a separate
thing. This is configured with the <context> tag
in the $TOMCAT_HOME/conf/server.xml file.

WAR files have nothing to do with paths at all; they
are just a convenient method of installing the bunch of
files making up a webapp.


PS: In future, please specify your tomcat VERSION, as
answers to questions often depend on which tomcat you
are using.

Regards,

Simon

> -----Original Message-----
> From: Thyagesh [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, December 18, 2000 7:52 AM
> To:   [EMAIL PROTECTED]
> Subject:      Need Some help..
> 
>  Hi,
>         I know its stupid. But I really struck with Tomcat's Docs & can't
> figure how to configure it. I had used JServ extensively. I had to migrate
> to Tomcat since I need a Servlet Container to Connect to IIS in Windows.
>        My Requirements are that I had to Run Servlets which are in
> packages.
> Hence I need mappings to these servlets. Also I need different context
> Paths
> to same set of code(ex: /servlet, /foo) like zones in JServ.
>     Thing I want to know whether I had to create a WAR file to make it
> work
> . OR Just add code to /webapps/root/.../classes(then where would be
> mappings??).
>     I had seen docs but couldn't figure out
> 
>     Any Help will be really useful. Please..
> 
> -Thyagesh
> 
> 

Reply via email to