tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Li" <>
Subject RE: How to obtain user's IP address
Date Thu, 03 May 2001 20:11:23 GMT
Thanks for the help. I tried getRemoteAddr() and getRemoteHost(). Both

Thanks again for the quick reply and the help.


-----Original Message-----
From: William Kaufman []
Sent: Thursday, May 03, 2001 11:44 AM
To: ''
Subject: RE: How to obtain user's IP address

getRemoteUser() returns the name of the user as authenticated by the servlet
engine: if you don't have authentication turned on, you'll always get back

getRemoteAddr() and getRemoteHost() will work, though,... assuming that
there's no weird address translation (like NAT) going on.

You could also plow through the request headers you're getting: some user
agents may tell you something useful.

                                                            -- Bill K.

> -----Original Message-----
> From: Jack Li []
> Sent: Thursday, May 03, 2001 7:35 AM
> To:
> Subject: How to obtain user's IP address
> Hello,
> I need to know who visits my web page. In jsp, I got "null"
> when I used
> "request.getRemoteUser()". Then any other mehods can obtain
> user's name or
> IP address?
> Thanks
> Jack Li

View raw message