tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hassan Schroeder <has...@webtuitive.com>
Subject Re: Different JDBC sources?
Date Tue, 13 Sep 2005 21:35:27 GMT
Vsevolod (Simon) Ilyushchenko wrote:

>> Presumably these are two different Contexts; put the appropriate
>> Resource in each ${context}.xml file...

> Thanks! How will different contexts be invoked depending on the URL?

Well, maybe I misunderstood the original question :-)

My presumption was that the same code exists at, say,
     http://dev.example.com/   and   http://www.example.com
which are clearly different Contexts, even if they're on the same
machine being run as virtual hosts.

So each Context has a Resource addressing the appropriate DB.

> Also, I need to distinguish between the test and production environment 
> in the code to figure out whether emails should be sent or not. Can I 
> detect the current context there?

If your setup is as described above, you could use getServerName();
alternatively, put a Parameter in the Context to turn on/off email
sending.

Apologies if this isn't relevant to your environment, though!

-- 
Hassan Schroeder ----------------------------- hassan@webtuitive.com
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

                           dream.  code.



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message