<2cents>
> try {
>   InetAddress addr = InetAddress.getLocalHost();
>   String hostname = addr.getHostName();
> } catch (UnknownHostException e) { }

This could easily return "localhost" (and the ip of 127.0.0.1) or
something as useless as this depending on your /etc/hosts. There is no
valid way to find out your address, since the url/domain that maps to
your server is not the domain your server runs at (think about vhosts,
loadbalancers, proxies and so on)

IMHO configuring it in an external file is the best reliable way to
get the data.
</2cents>

Leon

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to