tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Moria...@LastMinuteTravel.Com
Subject Mapping URL's to Same Context, Same Instance of Servlet
Date Mon, 30 Apr 2001 22:45:42 GMT
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.

Mime
View raw message