How can i trace the users IP address from a web application.. i tried with some existing methods in java. but its showing servers ip address..
How can i solve it..?
God Loves You and will never love you less.
Tim Moores
Rancher
Joined: Sep 21, 2011
Posts: 2329
posted
0
The HttpServletRequest object has methods to get the remote IP address. If you get "127.0.0.1" or some other local IP address, ask your server admin whether there's some kind of forwarding going on (also google for "x-forwarded-for" in that case).
Tim Moores wrote:The HttpServletRequest object has methods to get the remote IP address. If you get "127.0.0.1" or some other local IP address, ask your server admin whether there's some kind of forwarding going on (also google for "x-forwarded-for" in that case).
yes..i tried with 2-3 methods in HttpServletRequest. but still in vain. we have two servers for balancing the load,while executing the code,its just retrieving the proxy address.
Tim Moores wrote:The use of x-forwarded-for is the standard way to do this. Have you checked that it's not being used (and thus available to your servlet) already?
Yes i tried with the following code.,
But still getting the same address(server IP)..
Tim Moores
Rancher
Joined: Sep 21, 2011
Posts: 2329
posted
0
You need to have a chat with your server admin, then.