Re: Newbie : Obtain the name of a server in Java
Re: Newbie : Obtain the name of a server in Java
- Subject: Re: Newbie : Obtain the name of a server in Java
- From: Paul Lynch <email@hidden>
- Date: Thu, 7 Sep 2006 00:36:13 +0100
On 7 Sep 2006, at 00:28, Gilles MATHURIN wrote:
Is there a way to obtain programmaticaly the name of the server in
order to put it in a ivar ?
Example : "http://g-five.local/cgi-bin/Webobjects/WOapp.woa"
i'd like to be able to have the "g-five.local" part in a
programmatic way, in that way my method and component would be more
reusable…
No, in an absolute sense. Remember, your app is running on an
application server, which may not be the same as the web server that
the app is accessed through. There are two (or more) ways to get
around this:
- I normally provide the host name for the site as a parameter in
Properties.
- you could also extract it from the WORequest object, one of the
headers should have the value; I don't use this, so I hope someone
else can advise.
Paul _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden