This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes IP of the Client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "IP of the Client" Watch "IP of the Client" New topic
Author

IP of the Client

Karthik Prabu
Ranch Hand

Joined: Dec 27, 2002
Posts: 48
Hi All,
Is there any way to find the IP of the Client requesting a servlet other tha the getRemoteHost() and getRemoteAddr() API's.
Thanks
Karthik
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12759
    
    5
I sure don't know of any - whats wrong with using those ServletRequest methods? The whole idea of ServletRequest is that it encapsulates all the client request information.
Bill
Mauro Velasco
Greenhorn

Joined: May 13, 2003
Posts: 7
I need the Ip and Mac Address from a client, How can I do? with a servlet on iAS.
best regards
Mauro
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15951
    
  19

This question gets asked over and over again. You can search this forum for some of the detailed explanations, but in short, the IP address isn't reliable for identification puposes. Not only can it be spoofed, but it's often translated in the course of ordinary network operations. Plus there's DHCP.
MAC addresses probably would require a JNI glue class, but they're no more trustworthy. If you want a positive ID, look at some sort of certificate exhange. For most purposes, J2EE's security framework is adequate, however, and it doesn't break if the user's PC dies and they end up having to log in from someone else's box.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: IP of the Client
 
Similar Threads
trying to connect to another ip adress
Tomcat HttpSession inactivity
How to get client's IP address, Domain using Java
how to get the client's bowser URL who's hitting your service from ajax call?
Getiing Server IP address