You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Corbin, Ken" <Ke...@Summit.Fiserv.com> on 2002/06/27 19:28:15 UTC

Passing context parameters to we applications

What I've got is an application that serves three different customers.   I
want to set up three different contexts that run the same application with
three different databases.   Getting the three context configurations to
point to the same docBase directory is no problem.  But how does the
application determine which database to open?  I can probably dig the
calling URL out of the request context and parse it myself, but that's an
unsatisfactory solution.   What I really want to do is set a contextManager
property in each context configuration and somehow pass it to the web
application, but I haven't figured out how I can do that.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Passing context parameters to we applications

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 27 Jun 2002, Corbin, Ken wrote:

> Date: Thu, 27 Jun 2002 10:28:15 -0700
> From: "Corbin, Ken" <Ke...@Summit.Fiserv.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: "'tomcat-user@jakarta.apache.org'" <to...@jakarta.apache.org>
> Subject: Passing context parameters to we applications
>
> What I've got is an application that serves three different customers.   I
> want to set up three different contexts that run the same application with
> three different databases.   Getting the three context configurations to
> point to the same docBase directory is no problem.  But how does the
> application determine which database to open?  I can probably dig the
> calling URL out of the request context and parse it myself, but that's an
> unsatisfactory solution.   What I really want to do is set a contextManager
> property in each context configuration and somehow pass it to the web
> application, but I haven't figured out how I can do that.
>

If you are using Tomcat 4.x, see the documentation on the <Parameter>
element nested inside a <Context>.  This allows you to configure a context
initialization parameter in server.xml (i.e. external to the webapp).

  http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>