I have a REST- Server here using JERSEY. I must log the IP (better the DNS) of the calling client.
Can somebody point a direction which injection annotations to use ?
Searched “@Context”, but could not find anything fitting.
Thanks
Gerd
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
you could add
@Context HttpServletRequest requestas a parameter to your request handler method. And then get a hold of the client IP withrequest.getRemoteAddr()