[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tomcat-user
Subject:    Mapping URL's to Same Context, Same Instance of Servlet
From:       Morianos () LastMinuteTravel ! Com
Date:       2001-04-30 22:45:42
[Download RAW message or body]

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.

[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2650.12">
<TITLE>Mapping URL's to Same Context, Same Instance of Servlet</TITLE>
</HEAD>
<BODY>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 FACE="Arial">Hello All,</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 FACE="Arial">I am having a great deal of \
difficulty setting up this particular Apache / Tomcat environment.</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 FACE="Arial">I have one instance of tomcat \
running on a machine.&nbsp; In that JVM lives a Servlet we have developed.</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 FACE="Arial">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</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 FACE="Arial">In other words.</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">Directive&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Worker&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; How do I get \
there?&nbsp;&nbsp;&nbsp;&nbsp; Tomcat/Servlet/JVM</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">--------------------------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
-----------&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
----------------------------&nbsp;&nbsp;&nbsp; \
--------------------------------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 FACE="Arial">JkMount \
/mbt/3/*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mbt3&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
server1_ajp13_7020&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Servlet A in Tomcat A</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 FACE="Arial">JkMount \
/mbt/d1/*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mbt3&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; server1_ajp13_7020 \
&nbsp;&nbsp;&nbsp;&nbsp; Servlet A in Tomcat A</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 FACE="Arial">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.&nbsp; This is the \
part I want to change such that both</FONT> <FONT COLOR="#000000" SIZE=2 \
FACE="Arial">URLs</FONT><FONT COLOR="#000000" SIZE=2 FACE="Arial"></FONT> <FONT \
COLOR="#000000" SIZE=2 FACE="Arial">end up i</FONT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">n</FONT> <FONT COLOR="#000000" SIZE=2 FACE="Arial">t</FONT><FONT \
COLOR="#000000" SIZE=2 FACE="Arial">he same context.&nbsp; 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.</FONT><FONT COLOR="#000000" SIZE=2 FACE="Arial"> (I \
understand this is open source and evolving people)</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 FACE="Arial">Current setup.....</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 FACE="Arial">&lt;Context \
path=&quot;/mbt/3&quot;</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
docBase=&quot;webapps/mbt&quot;</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
crossContext=&quot;true&quot;</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
debug=&quot;0&quot;</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
reloadable=&quot;false&quot;</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
trusted=&quot;false&quot; &gt;</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Context&gt;</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Context \
path=&quot;/mbt/d1&quot;</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
docBase=&quot;webapps/mbt&quot;</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
crossContext=&quot;true&quot;</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
debug=&quot;0&quot;</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
reloadable=&quot;false&quot;</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
trusted=&quot;false&quot; &gt;</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Context&gt;</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 FACE="Arial">Desired setup: Something \
like.....</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Context \
path=&quot;/mbt/*&quot;</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
docBase=&quot;webapps/mbt&quot;</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
crossContext=&quot;true&quot;</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
debug=&quot;0&quot;</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
reloadable=&quot;false&quot;</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
trusted=&quot;false&quot; &gt;</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Context&gt;</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 FACE="Arial">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).</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 FACE="Arial">2. Where can I find good docs \
on all the capabilities of server.xml and web.xml. The jakarta online docs at &lt;<A \
HREF="http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/index.html" \
TARGET="_blank">http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/index.html</A>&gt; \
is limited in details.</FONT></P>

<P ALIGN=LEFT><FONT COLOR="#000000" SIZE=2 FACE="Arial">Thanks for your \
help.</FONT></P>

</BODY>
</HTML>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic