On Mar 30, 2009, at 9:22 AM, Robert Naczinski wrote:
> Hi,
>
> can I get the IP-Adress of the Client in a Jersey-Resource. In
> Servlet-Api can I get this with ServletRequest.getRemoteAddr()
>
There is no JAX-RS API for this. You need to inject
HttpServletRequest. For example:
@GET
public String get(@Context HttpServletRequest r) {
return r.getRemoteAddr();
}
Paul.
> Regards,
>
> Robert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>