This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
What is the difference between HttpServletRequest.getServerName() and getRemoteHost()
The javadoc says:
-getServerName():Returns the host name of the server that received the request. For HTTP servlets, same as the value of the CGI variable SERVER_NAME. -getRemoteHost():Returns the fully qualified name of the client that sent the request.
If I am sending the request from the same machine as the webserver is, shouldn't they be the same? I get my machine name for getServerName(), while a totally different machine address from getRemoteHost().