I'm using request.getRemoteAddr() in my servlet and it returns "127.0.0.1" to me, not the actual IP address. I need tha actual IP address. I'm accessing the Servlet from the same machine where the J2EE server is running. Could anyone please tell me what the problem is?
posted 9 years ago
What does it return if you access the server from some other machine?
This trick is handy when testing IP-specific code. We had specific code for Kiosks running on fixed addresses. If you register one IP in your app then you can send requets and test the code works correctly.