The javadoc is a bit confusing to me, and in my local tests it seems like they both return the same thing. What am I missing here?
views:
181answers:
3
+1
A:
getRemoteHost
returns the name of the client that sent the request, while getServerName
returns the name of the server that received the request.
It might be the same results in your local tests if you are using two machines on the network, one as a client and one for the server.
Anthony Forloney
2010-02-22 19:24:54
A:
I'm not sure where this confusion is coming from, the javadoc is very explicit:
Returns the fully qualified name of the client or the last proxy that sent the request.
Returns the host name of the server to which the request was sent.
skaffman
2010-02-22 22:55:24
A:
They are both the same thing, because you runs both the client and server at the same machine.
BalusC
2010-02-23 22:20:37