users@jersey.java.net

Re: [Jersey] How can I get client IP in Jesery resource class?

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 18 Nov 2008 10:56:52 +0100

On Nov 18, 2008, at 2:34 AM, Hugo Zhu wrote:

> Hi,
>
> If I have a resource class like below.
> @Context
> Request request;
>
> @GET
> @Path("/test1")
> public String test1(@Context UriInfo ui,_at_Context HttpHeaders hh) {
>
> }
>
> It seems i can't get the client's IP from request, uriInfo or
> httpHeaders. Please help.
>

See this on the dev list:

http://markmail.org/search/?q=list%3Anet.java.dev.jersey.dev#query:list
%3Anet.java.dev.jersey.dev+page:1+mid:jzt2ovw642brsyzc+state:results

There is currently no abstraction to obtain such information and it is
necessary to utilize HttpServletRequest.

Hope that helps,
Paul.

P.S. i don't recommend using the dev list, as most email traffic is on
the users list and both users/developers appear happy at least at the
moment to mostly utilize one list.