Re: [Jersey] How to Get Remote IP address in JAX/RS with Grizzly

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Date: Wed, 17 Feb 2010 11:00:44 +0100


>> I would like to get the remote IP address of the JAX-RS client for
>> logging purposes. I understand that I can inject an
>> HttpServletRequest
>> if I am running in a servlet container, but I am using the Grizzly
>> server embedded in my application container.
>> I looked through the Grizzly documentation and can't quite determine
>> what class I need to implement (ProtocolHandler, perhaps?) and how to
>> attach it to the Grizzly pipeline created for me by the Jersey
>> integration with Grizzly.
>> I would prefer a lower-level technique so I can integrate it in my
>> application framework instead of injecting into each resource.
> Hmm... cross posting to the Grizzly users list.
> If there is a way to get the client IP address from the low-level
> Grizzly request i can add a method to HttpRequestContext so that it
> is supported in a platform independent way.
Yes, low-level Grizzly request has:


> Paul.
>> Thanks.
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail: