Get Users IP Address in a Servlet



This code example shows how to obtain the IP address of the user that calls the server.
The Request object has a few neat methods to get information about the call and about the caller, and one of them is named getRemoteAddr() which returns the IP address of the calling computer.
In the example below we print out the IP address on a blank html-page.







Search for more Java info on this site here:
Custom Search


Any thoughts or questions?