On Mon, 11 Sep 2000, Christopher K. St. John wrote:
> Milt Epstein wrote:
> >
> > > Myself, I have no problem with getRemoteAddr(), but getRemoteHost()
> > > returns nothing.
> >
> > In all cases? That could be a bug with your servlet container.
>
> Often web servers turn off name lookup, since it can be very
But note that he said "returns nothing" above -- according to the
spec, as you quote below, if getRemoteHost() doesn't return the host
name, it should return the IP address. (Maybe he didn't really means
"returns nothing" though.)
> expensive. getRemoteHost() is supposed to be equivalent to the CGI
> variable REMOTE_HOST. So not returning anything useful is allowable
> behavior.
>
> The 2.3 spec says:
>
> getRemoteHost()
> public java.lang.String getRemoteHost()
>
> Returns the fully qualified name of the client that sent
> the request, or the IP address of the client if the name
> cannot be determined. For HTTP servlets, same as the value
> of the CGI variable REMOTE_HOST.
[ ... ]
Doesn't this just beg the question of the how the value of REMOTE_HOST
is determined? I don't think this is saying that REMOTE_HOST is a
substitute for getRemoteHost(), but rather that they serve the same
purpose.
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