It seems like you should be able to do what you want with the
<servlet-mapping> directives in web.xml. With these, you can use wildcards
to map different URI's to the same servlet -- and, I believe, the same
instance.
A good resource I have found is http://tomcat.mslinn.com/. It has an
overview of both the server.xml and web.xml files, plus links to the servlet
spec and API. Check out the <servlet-mapping> directive there and see if it
solves your problem.
Thanks,
--jeff
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 30, 2001 3:45 PM
Subject: Mapping URL's to Same Context, Same Instance of Servlet
> Hello All,
>
> I am having a great deal of difficulty setting up this particular Apache /
> Tomcat environment.
>
> I have one instance of tomcat running on a machine. In that JVM lives a
> Servlet we have developed.
>
> For programmatic reasons, we want to have multiple URL's coming into the
> Apache Server, to be handled by the same instance of that Servlet within
the
> Tomcat JVM, not another instance of the same Servlet in the Tomcat JVM
>
> In other words.
>
> Directive Worker How do I get there?
> Tomcat/Servlet/JVM
> -------------------------- -----------
> ---------------------------- --------------------------------
> JkMount /mbt/3/* mbt3 server1_ajp13_7020 Servlet A in
> Tomcat A
> JkMount /mbt/d1/* mbt3 server1_ajp13_7020 Servlet A in
> Tomcat A
>
> The problem I am running into is that if two requests come in across both
> URL's then I end up with two Servlet instances running in one Tomcat JVM
> under two different Contexts. This is the part I want to change such that
> both URLs end up in the same context. I sense the secret lies in
> server.xml, or further maybe in web.xml but the documentation for these
> files is scarce to say the least. (I understand this is open source and
> evolving people)
>
> Current setup.....
> <Context path="/mbt/3"
> docBase="webapps/mbt"
> crossContext="true"
> debug="0"
> reloadable="false"
> trusted="false" >
> </Context>
> <Context path="/mbt/d1"
> docBase="webapps/mbt"
> crossContext="true"
> debug="0"
> reloadable="false"
> trusted="false" >
> </Context>
>
> Desired setup: Something like.....
> <Context path="/mbt/*"
> docBase="webapps/mbt"
> crossContext="true"
> debug="0"
> reloadable="false"
> trusted="false" >
> </Context>
>
> 1. But Tomcat does not understand wildcards in the path. Is there any way
to
> either specify multiple Paths for the SAME context or even tell Tomcat to
> operate under a single context regardless of path (because I'll have no
> other contexts in this jvm).
> 2. Where can I find good docs on all the capabilities of server.xml and
> web.xml. The jakarta online docs at
> <http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/index.html> is
> limited in details.
>
> Thanks for your help.
>