• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Newbie : Obtain the name of a server in Java
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Newbie : Obtain the name of a server in Java (From: Gilles MATHURIN <email@hidden>)

  • Prev by Date: Newbie : Obtain the name of a server in Java
  • Next by Date: Re: Newbie : Obtain the name of a server in Java
  • Previous by thread: Newbie : Obtain the name of a server in Java
  • Next by thread: Re: Newbie : Obtain the name of a server in Java
  • Index(es):
    • Date
    • Thread