Thanks, issue logged:
https://jersey.dev.java.net/issues/show_bug.cgi?id=473
Until this is fixed i think the only way you can do this is to extend/
modify Jersey's GrizzlyContainer:
com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer
override the service method and add the relevant information as a
property on the ContainerRequest implementation. see
ContainerRequest.getProperties(). Then inject HttpContext onto your
resource class to get access to those properties. Or perhaps define an
injectable provider to do the same thing.
Paul.
On Feb 17, 2010, at 11:00 AM, Oleksiy Stashok wrote:
> Hi,
>
>>> 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:
> request.remoteAddr().toString();
> request.getRemotePort();
>
> WBR,
> Alexey.
>
>>
>> Paul.
>>
>>
>>> Thanks.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>