Christof Baumgaertner wrote:
> What about:
>
> import java.net.*;
> InetAddress theIPaddress = null;
> try {
> theIPaddress = InetAddress.getLocalHost();
> theIPaddress.getHostName();
> }
> catch (UnknownHostException e) {
>
This will not necessarily give you the right answer, if you are hosting multiple
virtual hosts on one servlet engine. The logic above will return the primary
name for the server. Calling request.getServerName() will give you the name of
the virtual host that received and is processing this request.
Craig McClanahan
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html