You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Lyallex <ly...@gmail.com> on 2010/12/08 10:10:03 UTC

Getting hold of an IP address

Hi

apache-tomcat-6.0.16
jdk1.6.0_03

My application contains instances of
javax.servlet.http.HttpSessionListener
and
javax.servlet.Filter
(among other classes of course)

My question is, is it possible to obtain the originating IP address of
a request from either of these classes
I've had a good look around with no luck so far.

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Getting hold of an IP address

Posted by Lyallex <ly...@gmail.com>.
On 8 December 2010 10:04, Konstantin Kolinko <kn...@gmail.com> wrote:

> ServletRequest.getRemoteAddr()
>
> (In a Filter.  There is no request in HttpSessionListener).
>
> Best regards,
> Konstantin Kolinko
>
ahem ... yes, well that was easy wasn't it
In my (weak) defense it's been a long while since I did any coding

Thank you

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Getting hold of an IP address

Posted by Konstantin Kolinko <kn...@gmail.com>.
2010/12/8 Lyallex <ly...@gmail.com>:
> My application contains instances of
> javax.servlet.http.HttpSessionListener
> and
> javax.servlet.Filter
> (among other classes of course)
>
> My question is, is it possible to obtain the originating IP address of
> a request from either of these classes
>

ServletRequest.getRemoteAddr()

(In a Filter.  There is no request in HttpSessionListener).

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org