users@jersey.java.net

Re: How to obtain HttpServletRequest (or get RemoteAddress)

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 05 Mar 2008 15:00:46 +0100

Martin Grotzke wrote:
> I want to obtain the remote address of the client and would fetch this
> from the HttpServletRequest. So how can I get access to the current
> request in jersey?
>

   @Path("/")
   public class Foo {
     @Resource HttpServletRequest request;
     ...
   }

Perhaps this information should be part of UriInfo? Basically it is the
resolved host name in the client request URI?

Paul.

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109