File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes getRemoteAddr vs getRemoteHost Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "getRemoteAddr vs getRemoteHost" Watch "getRemoteAddr vs getRemoteHost" New topic

getRemoteAddr vs getRemoteHost

Adrian Krebs

Joined: Apr 10, 2002
Posts: 11
Whats the difference from request.getRemoteAddr()
to request.getRemoteHost().
Many thanks!
Tim Baker
Ranch Hand

Joined: Oct 04, 2003
Posts: 541
java.lang.String getRemoteAddr()
Returns the Internet Protocol (IP) address of the client that sent the request.
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 example the first one may give
whilst the second might give

Kim Jong II (North Korea's Dear Leader) said:Nuclear weapons don't kill people, people kill people.
Adrian Krebs

Joined: Apr 10, 2002
Posts: 11
OK, thank you
I agree. Here's the link:
subject: getRemoteAddr vs getRemoteHost
It's not a secret anymore!