Checked the archives and dejanews, and couldn't find an answer to this
one.
A machine can have more than one FQDN, so the name used in a URL might
be different from the "actual" server name (I don't mean the canonical
name, but rather the name the web server knows -- this can be
configured, in NES, at least). CGI apparently provides the
environment variables HTTP_HOST and SERVER_NAME to distinguish between
these (HTTP_HOST actually includes the port, while SERVER_NAME does
not). I could only find getServerName() in the JSDK API. This
apparently corresponds to HTTP_HOST (without the port). Is there any
way I can get both of these names in a servlet?
I thought of InetAddress.getLocalHost(), but I don't think that will
work. I'm guessing that will return the canonical name of the server,
which is not necessarily the same.
Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]
___________________________________________________________________________
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