users@jersey.java.net

[Jersey] Re: Get the IP addr associated with cinoming request

From: Florian Hehlen <Florian.Hehlen_at_imc.nl>
Date: Thu, 31 Mar 2011 13:27:42 +0000

I went down this path and ended up adding special headers in my requests because I could not guarantee/enforce that http proxies in between me and my clients would forward the requesting IP. I do have the luxury of providing client side code so I can in most cases ensure that these headers will be provided.

Cheers,
flo

-----Original Message-----
From: Jakub Podlesak [mailto:jakub.podlesak_at_oracle.com]
Sent: Wednesday, March 30, 2011 10:52 PM
To: users_at_jersey.java.net
Subject: [Jersey] Re: Get the IP addr associated with cinoming request

On the Servlet container, you should be able to get the HttpServletRequest injected:

@Context HttpServletRequest req;

and get the address from there.

Does it help you?

~Jakub

On 03/30/2011 01:19 PM, Arthur Yeo wrote:
> All,
> When servicing a request in Jersey, is there a fast way to obtain the
> IP-addr of the client?
>
> --
> Arthur Y.


________________________________

The information in this e-mail is intended only for the person or entity to which it is addressed.

It may contain confidential and /or privileged material. If someone other than the intended recipient should receive this e-mail, he / she shall not be entitled to read, disseminate, disclose or duplicate it.

If you receive this e-mail unintentionally, please inform us immediately by "reply" and then delete it from your system. Although this information has been compiled with great care, neither IMC Financial Markets & Asset Management nor any of its related entities shall accept any responsibility for any errors, omissions or other inaccuracies in this information or for the consequences thereof, nor shall it be bound in any way by the contents of this e-mail or its attachments. In the event of incomplete or incorrect transmission, please return the e-mail to the sender and permanently delete this message and any attachments.

Messages and attachments are scanned for all known viruses. Always scan attachments before opening them.