You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Chris Norris <CN...@widen.com> on 2003/10/29 16:13:38 UTC

I need to find the domain I'm in

I have emails that get sent out to admins in the system... but I want to
have it act differently depending on whether it's on the production server
or it's local.  So if the domain is localhost, emails only get sent to
developers, but if it's something other than local host, emails get sent to
all admins.  Is there a better way to go about doing this?  I suppose I
could set some sort of debug variable somewhere.
 
-Chris

Re: I need to find the domain I'm in

Posted by Detlef Schulze <de...@jaide.de>.
Check the IP of the server (only possible if you are using a 1.4+ JDK)

or

set a System property with the -D switch when starting up your servlet
engine i.e. "java -Drunning_on_hot"


I once saw a WebObjects Project that had a list of IPs and changed its
behavior depending on what machine it was deployed on. Worked pretty good.


----- Original Message -----
From: "Chris Norris" <CN...@widen.com>
To: "'Tapestry Users List'" <ta...@jakarta.apache.org>
Sent: Wednesday, October 29, 2003 4:13 PM
Subject: I need to find the domain I'm in


> I have emails that get sent out to admins in the system... but I want to
> have it act differently depending on whether it's on the production server
> or it's local.  So if the domain is localhost, emails only get sent to
> developers, but if it's something other than local host, emails get sent
to
> all admins.  Is there a better way to go about doing this?  I suppose I
> could set some sort of debug variable somewhere.
>
> -Chris
>


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


Re: I need to find the domain I'm in

Posted by Darren Foltinek <da...@frontrange.ca>.
To set variables that depend on the deployment environment (production or 
development) I use ANT to set servlet init-parameter variables in  the 
web.xml file.  Then do an "ant" or "ant production" to build the 
deployment-specific WAR file.

Can post details if you want...

-- Darren


>I have emails that get sent out to admins in the system... but I want to
>have it act differently depending on whether it's on the production server
>or it's local.  So if the domain is localhost, emails only get sent to
>developers, but if it's something other than local host, emails get sent to
>all admins.  Is there a better way to go about doing this?  I suppose I
>could set some sort of debug variable somewhere.
>
>-Chris



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