This week's book giveaway is in the
We're giving away four copies of
Arduino in Action
and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Arduino in Action
this week in the
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
Can we get Remote IP Address without using HttpServletRequest?
Joined: Aug 26, 2009
Mar 03, 2010 06:18:56
Can we get Remote IP Address without using
I have the solution like below:
public void doGet(
remoteInetAddress = InetAddress.getByName(req.getRemoteAddr());
Could you please provide me any alternate solution with out using
Thanks & Regards
Joined: Sep 29, 2008
Mar 03, 2010 06:33:36
How? The request is the *only* information you have from the client, no?
Joined: Mar 05, 2007
Mar 04, 2010 13:26:37
David is totally right , but the question here is why you wanna get Remote IP Address without using
Joined: Aug 30, 2005
Apr 02, 2010 16:27:20
The following code results in the output shown in comments.....
String ss = a.getRequest().getRemoteUser()+"/"+a.getRequest().getRemoteAddr()+"/"+a.getRequest().getRemoteHost(); // The output of ss is now equal to 'null/0:0:0:0:0:0:0:1%0/0:0:0:0:0:0:0:1%0' ...
Thus none of these methods have useable information.
How can I get a real IP address Gets no useable data.... Why ? I need the users ip address for logging purposes... And I recall the "getRemoteAddr())" method as working.
Author and all-around good cowpoke
Joined: Mar 22, 2000
Apr 03, 2010 08:22:57
server.xml there is an "enableLookups" setting - set this to true and see what happens.
The comments in server.xml explain it all.
Java Resources at
I agree. Here's the link:
subject: Can we get Remote IP Address without using HttpServletRequest?
struts 2 getting remote client ip address
How can i Get Client's IP Address in JSR168 Portlets
How to trace Client IP address
how to ip scan
Getting IP address of User
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013