Retrieve IP address
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   aung_thet
Posted On:   Tuesday, June 11, 2002 11:38 PM

I want to retrieve IP adress of the computer of the browser
once they log in into my web site.



Anything I can do about it in servlet?



If not in servlet, is there another possible way to do?

Re: Retrieve IP address

Posted By:   michael_dean  
Posted On:   Wednesday, June 12, 2002 07:09 AM

Also, remember that the IP address may not be sent by the browser. It, like any other information sent in headers, is optional. See Re: request.getHeader("REFERER") is null?? for more information.



Also, users may access your site through a proxy server. If so, the reported IP address could very well be the same for multiple users.



Just a couple of cases you might want to plan for. . .

Re: Retrieve IP address

Posted By:   Martin_Kernland  
Posted On:   Tuesday, June 11, 2002 11:51 PM

Hi

sure:

String ipAddr = request.getRemoteAddr();

or

String hostAddr = request.getRemoteHost();



(BTW: there are many other usefull methods...just check out the javadoc or any other documentation.)

-Martin
About | Sitemap | Contact